all repos — tint2 @ 94a8948466bb2c2ce2199153236574b37297b11a

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

fixed bug when active window draged to another desktop

git-svn-id: http://tint2.googlecode.com/svn/trunk@135 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
lorthiois@bbsoft.fr lorthiois@bbsoft.fr@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
commit

94a8948466bb2c2ce2199153236574b37297b11a

parent

f100b491589c16b7144c98c7864af13b9dde090c

4 files changed, 15 insertions(+), 7 deletions(-)

jump to
M ChangeLogChangeLog

@@ -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
M src/taskbar/task.csrc/taskbar/task.c

@@ -34,10 +34,10 @@ #include "panel.h"

-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 @@ Task new_tsk;

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 @@ //printf("task %s : desktop %d, monitor %d\n", new_tsk->title, desktop, monitor);

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 @@ tskbar->area.resize = 1;

//printf("add_task panel %d, desktop %d, task %s\n", i, j, new_tsk2->title); } } + return new_tsk2; }
M src/taskbar/task.hsrc/taskbar/task.h

@@ -51,7 +51,7 @@ } Task;

-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);
M src/tint.csrc/tint.c

@@ -479,11 +479,16 @@ }

// 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; } }