From 8af2c4f1e83ab25ed5108490559742ab353e166a Mon Sep 17 00:00:00 2001 From: Joe Konno Date: Mon, 26 Nov 2012 12:57:09 -0800 Subject: [PATCH 2/2] desktop-shell: Panel clock option The [shell] section of weston.ini now contains a boolean "clock" option. By default the panel clock is enabled for desktop-shell. Add a commented configuration line to weston.ini to advertise this option. This is intended for situations where a panel clock, which emits a redraw event every minute, is undesirable. Signed-off-by: Joe Konno --- clients/desktop-shell.c | 10 +++++++--- weston.ini | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c index 83a98e0..596961f 100644 --- a/clients/desktop-shell.c +++ b/clients/desktop-shell.c @@ -123,6 +123,7 @@ static char *key_launcher_icon; static char *key_launcher_path; static void launcher_section_done(void *data); static int key_locking = 1; +static int key_clock = 1; static const struct config_key shell_config_keys[] = { { "background-image", CONFIG_KEY_STRING, &key_background_image }, @@ -130,6 +131,7 @@ static const struct config_key shell_config_keys[] = { { "panel-color", CONFIG_KEY_UNSIGNED_INTEGER, &key_panel_color }, { "background-color", CONFIG_KEY_UNSIGNED_INTEGER, &key_background_color }, { "locking", CONFIG_KEY_BOOLEAN, &key_locking }, + { "clock", CONFIG_KEY_BOOLEAN, &key_clock }, }; static const struct config_key launcher_config_keys[] = { @@ -479,7 +481,8 @@ panel_destroy(struct panel *panel) struct panel_launcher *tmp; struct panel_launcher *launcher; - panel_destroy_clock(panel->clock); + if (key_clock) + panel_destroy_clock(panel->clock); wl_list_for_each_safe(launcher, tmp, &panel->launcher_list, link) panel_destroy_launcher(launcher); @@ -509,8 +512,9 @@ panel_create(struct display *display) widget_set_redraw_handler(panel->widget, panel_redraw_handler); widget_set_resize_handler(panel->widget, panel_resize_handler); widget_set_button_handler(panel->widget, panel_button_handler); - - panel_add_clock(panel); + + if (key_clock) + panel_add_clock(panel); return panel; } diff --git a/weston.ini b/weston.ini index cb88eba..db7e9c7 100644 --- a/weston.ini +++ b/weston.ini @@ -4,6 +4,7 @@ background-image=/usr/share/backgrounds/gnome/Aqua.jpg background-color=0xff002244 panel-color=0x90ff0000 locking=true +#clock=false animation=zoom #binding-modifier=ctrl #num-workspaces=6 -- 1.7.11.7