]> Dogcows Code - chaz/tint2/commitdiff
remove patch on omnipresent task to try another solution
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Fri, 25 Sep 2009 21:40:06 +0000 (21:40 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Fri, 25 Sep 2009 21:40:06 +0000 (21:40 +0000)
src/panel.h
src/taskbar/task.c
src/taskbar/taskbar.c
src/taskbar/taskbar.h
src/tint.c

index 9676089beb8dd0fa89a64e55aa64bb65286ea416..9fd52bc3574f34d0c1d563f6a27b25e853eb3ee4 100644 (file)
@@ -57,6 +57,7 @@ extern int  max_tick_urgent;
 extern Imlib_Image default_icon;
 
 
+// tint2 use one panel per monitor and one taskbar per desktop.
 typedef struct {
        // always start with area
        // area.list own all objects of the panel according to config file
index 383d99e7b2b13a3faf1bf41acaa9de3ca05d198f..cbd1b0765495241c4d125ae95ce1802cbed73e81 100644 (file)
@@ -61,16 +61,16 @@ Task *add_task (Window win)
        Taskbar *tskbar;
        Task *new_tsk2=0;
        int i, j;
-       for (i = 0; i < nb_panel; i++) {
-               if (nb_panel > 1 && panel1[i].monitor != monitor) continue;
-               for (j = 0; j < panel1[i].nb_desktop; j++) {
-                       if ((new_tsk.desktop != ALLDESKTOP && new_tsk.desktop != j)
-                       || (panel_mode == MULTI_DESKTOP && new_tsk.desktop == ALLDESKTOP && server.desktop != j))
-                               continue;
-//     for (i=0 ; i < nb_panel ; i++) {
-//             for (j=0 ; j < panel1[i].nb_desktop ; j++) {
-//                     if (new_tsk.desktop != ALLDESKTOP && new_tsk.desktop != j) continue;
-//                     if (nb_panel > 1 && panel1[i].monitor != monitor) continue;
+//     for (i = 0; i < nb_panel; i++) {
+//             if (nb_panel > 1 && panel1[i].monitor != monitor) continue;
+//             for (j = 0; j < panel1[i].nb_desktop; j++) {
+//                     if ((new_tsk.desktop != ALLDESKTOP && new_tsk.desktop != j)
+//                     || (panel_mode == MULTI_DESKTOP && new_tsk.desktop == ALLDESKTOP && server.desktop != j))
+//                             continue;
+       for (i=0 ; i < nb_panel ; i++) {
+               for (j=0 ; j < panel1[i].nb_desktop ; j++) {
+                       if (new_tsk.desktop != ALLDESKTOP && new_tsk.desktop != j) continue;
+                       if (nb_panel > 1 && panel1[i].monitor != monitor) continue;
 
                        tskbar = &panel1[i].taskbar[j];
                        new_tsk2 = malloc(sizeof(Task));
index a1be3ec78236220ec049ec53f0ad2a4dd12df247..f20e89e0cff6597181e518734f9a2b7ae0b82f2f 100644 (file)
@@ -258,6 +258,7 @@ void resize_taskbar(void *obj)
                x = taskbar->area.posx + taskbar->area.pix.border.width + taskbar->area.paddingxlr;
                for (l = taskbar->area.list; l ; l = l->next) {
                        tsk = l->data;
+                       if (!tsk->area.on_screen) continue;
                        tsk->area.posx = x;
                        tsk->area.width = pixel_width;
                        tsk->area.redraw = 1;
@@ -299,6 +300,7 @@ void resize_taskbar(void *obj)
                y = taskbar->area.posy + taskbar->area.pix.border.width + taskbar->area.paddingxlr;
                for (l = taskbar->area.list; l ; l = l->next) {
                        tsk = l->data;
+                       if (!tsk->area.on_screen) continue;
                        tsk->area.posy = y;
                        tsk->area.height = pixel_height;
                        tsk->area.redraw = 1;
index 67733db5f92b46479edf03efe113d2de4f631726..0901ed5a945967ee751b4182a49ffa2dce8eb4ba 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "task.h"
 
-
+// tint2 use one taskbar per desktop.
 typedef struct {
        // always start with area
        Area area;
index b72b46eb4f16861c584cc81f7a5e31e529c61483..0518486bc39352a83c2f1916434288cea401a942 100644 (file)
@@ -394,52 +394,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++) {
+                       for (i=0 ; i < nb_panel ; i++) {
                                Panel *panel = &panel1[i];
-                               if (panel_mode == MULTI_DESKTOP) {
-                                       Taskbar *tskbar, *tskbar_active;
-                                       GSList *l;
+                               if (panel_mode == MULTI_DESKTOP && panel->g_taskbar.use_active) {
+                                       // redraw taskbar
+                                       panel_refresh = 1;
+                                       Taskbar *tskbar;
                                        Task *tsk;
-                                       char redraw_tasks;
-
-                                       tskbar_active = &panel->taskbar[server.desktop];
-                                       if (panel->g_taskbar.use_active) {
-                                               tskbar_active->area.is_active = 1;
-                                               tskbar_active->area.redraw = 1;
+                                       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;
+                                                       }
+                                               }
                                        }
-
-                                       for (j = 0; j < panel->nb_desktop; j++) {
-                                               tskbar = &panel->taskbar[j];
-
-                                               // need to redraw tasks only on taskbar, which was active, or which became active
-                                               redraw_tasks = 0;
-                                               if (panel->g_taskbar.use_active && tskbar->area.is_active && tskbar != tskbar_active) {
-                                                       tskbar->area.is_active = 0;
-                                                       tskbar->area.redraw = 1;
-                                                       redraw_tasks = 1;
-                                               } else if (panel->g_taskbar.use_active && tskbar == tskbar_active) {
-                                                       redraw_tasks = 1;
-                                               }
-
-                                               for (l = tskbar->area.list; l;) {
-                                                       tsk = l->data;
-                                                       l = l->next;
-
-                                                       if (redraw_tasks) tsk->area.redraw = 1;
-
-                                                       if (tsk->desktop == ALLDESKTOP && tskbar != tskbar_active) {
-                                                               // move omnipresent tasks to current taskbar
-                                                               tskbar->area.list = g_slist_remove(tskbar->area.list, tsk);
-                                                               tskbar->area.resize = 1;
-                                                               tsk->area.parent = tskbar_active;
-                                                               tskbar_active->area.list = g_slist_append(tskbar_active->area.list, tsk);
-                                                               tskbar_active->area.resize = 1;
-                                                       }
-                                               }
-                                       }
-                                       panel_refresh = 1;
-                               }
-                       }
+                               }
+                       }
                        if (panel_mode != MULTI_DESKTOP) {
                                visible_object();
                        }
This page took 0.032177 seconds and 4 git commands to generate.