]> Dogcows Code - chaz/tint2/commitdiff
fixed bug when active window draged to another desktop
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Mon, 29 Jun 2009 19:50:29 +0000 (19:50 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Mon, 29 Jun 2009 19:50:29 +0000 (19:50 +0000)
ChangeLog
src/taskbar/task.c
src/taskbar/task.h
src/tint.c

index 6216a06eb67e66f7feb99a8bccf1c20f084a3069..d100dee3e9a67a81b8e81ec37c66db7dc4088a9c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2009-06-29
+- fixed bug when active window draged to another desktop
+
 2009-06-29
 - fixed issue 110 and issue 107
 
index 0b8bdc8c98a9a16cacb6345b2254b6cd3ed5bbed..2e0cc93133a237ba231293fe17da38e3300a5980 100644 (file)
 
 
 
-void add_task (Window win)
+Task *add_task (Window win)
 {
-   if (!win) return;
-   if (window_is_hidden(win)) return;
+   if (!win) return 0;
+   if (window_is_hidden(win)) return 0;
 
    int monitor;
 
@@ -45,7 +45,6 @@ void add_task (Window win)
    new_tsk.win = win;
    new_tsk.area.panel = &panel1[0];
    new_tsk.desktop = window_get_desktop (win);
-//   if (panel_mode == SINGLE_MONITOR) monitor = window_get_monitor (win);
    if (nb_panel > 1) monitor = window_get_monitor (win);
    else monitor = 0;
 
@@ -60,7 +59,7 @@ void add_task (Window win)
    XSelectInput (server.dsp, new_tsk.win, PropertyChangeMask|StructureNotifyMask);
 
        Taskbar *tskbar;
-   Task *new_tsk2;
+   Task *new_tsk2=0;
        int i, j;
        for (i=0 ; i < nb_panel ; i++) {
                for (j=0 ; j < panel1[i].nb_desktop ; j++) {
@@ -82,6 +81,7 @@ void add_task (Window win)
                        //printf("add_task panel %d, desktop %d, task %s\n", i, j, new_tsk2->title);
                }
        }
+       return new_tsk2;
 }
 
 
index 5f1ecf15d4225b604bbeb514f0afbee5bd66f126..a42caa0016e0c9d549fe6a6738e501851f70edb3 100644 (file)
@@ -51,7 +51,7 @@ typedef struct {
 
 
 
-void add_task (Window win);
+Task *add_task (Window win);
 void remove_task (Task *tsk);
 
 void draw_task (void *obj, cairo_t *c, int active);
index e5bde53391fe2d88e24c7362d55eace541de3bff..87a57fc2b497e3dc086fafa7784d2cbe4349c8e5 100644 (file)
@@ -479,11 +479,16 @@ void event_property_notify (XEvent *e)
       // Window desktop changed
       else if (at == server.atom._NET_WM_DESKTOP) {
                        int desktop = window_get_desktop (win);
+                       int active = tsk->area.is_active;
                        //printf("  Window desktop changed %d, %d\n", tsk->desktop, desktop);
                        // bug in windowmaker : send unecessary 'desktop changed' when focus changed
                        if (desktop != tsk->desktop) {
                                remove_task (tsk);
-                               add_task (win);
+                               tsk = add_task (win);
+                               if (tsk && active) {
+                                       tsk->area.is_active = 1;
+                                       task_active = tsk;
+                               }
                                panel_refresh = 1;
                        }
       }
This page took 0.028078 seconds and 4 git commands to generate.