From: Thierry Lorthiois Date: Sun, 30 Aug 2009 15:40:02 +0000 (+0000) Subject: added taskbar_active_background_id to change current desktop background X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=bdf5fa4daad88f6a65b6f4be3acae7b663906e86;p=chaz%2Ftint2 added taskbar_active_background_id to change current desktop background --- diff --git a/ChangeLog b/ChangeLog index 235dfcd..7c49eed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-30 +- added taskbar_active_background_id to change current desktop background. + warning : this feature have a price on cpu (tint2 redraw all task) when you switch desktop. + comment out taskbar_active_background_id if you don't want it. + 2009-08-30 - fixed issue 130 by maato ordered systray icon with config "systray_sort = asc/desc" diff --git a/src/config.c b/src/config.c index a7d11a2..fce3ff9 100644 --- a/src/config.c +++ b/src/config.c @@ -85,6 +85,7 @@ void init_config() panel_config = calloc(1, sizeof(Panel)); systray.sort = 1; + // window manager's menu default value == false wm_menu = 0; max_tick_urgent = 7; @@ -476,6 +477,13 @@ void add_entry (char *key, char *value) memcpy(&panel_config->g_taskbar.pix.back, &a->pix.back, sizeof(Color)); memcpy(&panel_config->g_taskbar.pix.border, &a->pix.border, sizeof(Border)); } + else if (strcmp (key, "taskbar_active_background_id") == 0) { + int id = atoi (value); + Area *a = g_slist_nth_data(list_back, id); + memcpy(&panel_config->g_taskbar.pix_active.back, &a->pix.back, sizeof(Color)); + memcpy(&panel_config->g_taskbar.pix_active.border, &a->pix.border, sizeof(Border)); + panel_config->g_taskbar.use_active = 1; + } /* Task */ else if (strcmp (key, "task_text") == 0) diff --git a/src/taskbar/taskbar.c b/src/taskbar/taskbar.c index 5619aa8..6fe5173 100644 --- a/src/taskbar/taskbar.c +++ b/src/taskbar/taskbar.c @@ -103,6 +103,8 @@ void init_taskbar() tskbar = &panel->taskbar[j]; memcpy(&tskbar->area, &panel->g_taskbar, sizeof(Area)); tskbar->desktop = j; + if (j == server.desktop && tskbar->area.use_active) + tskbar->area.is_active = 1; // add taskbar to the panel panel->area.list = g_slist_append(panel->area.list, tskbar); diff --git a/src/tint.c b/src/tint.c index 4eb8cc7..a75b1b4 100644 --- a/src/tint.c +++ b/src/tint.c @@ -388,6 +388,35 @@ void event_property_notify (XEvent *e) // Change desktop else if (at == server.atom._NET_CURRENT_DESKTOP) { server.desktop = server_get_current_desktop (); + for (i=0 ; i < nb_panel ; i++) { + Panel *panel = &panel1[i]; + if (panel_mode == MULTI_DESKTOP && panel->g_taskbar.use_active) { + // redraw taskbar + panel_refresh = 1; + Taskbar *tskbar; + Task *tsk; + GSList *l; + for (j=0 ; j < panel->nb_desktop ; j++) { + tskbar = &panel->taskbar[j]; + if (tskbar->area.is_active) { + tskbar->area.is_active = 0; + tskbar->area.redraw = 1; + for (l = tskbar->area.list; l ; l = l->next) { + tsk = l->data; + tsk->area.redraw = 1; + } + } + if (j == server.desktop) { + tskbar->area.is_active = 1; + tskbar->area.redraw = 1; + for (l = tskbar->area.list; l ; l = l->next) { + tsk = l->data; + tsk->area.redraw = 1; + } + } + } + } + } if (panel_mode != MULTI_DESKTOP) { visible_object(); }