]> Dogcows Code - chaz/tint2/commitdiff
*fix* minor bugfixes
authorAndreas Fink <andreas.fink85@googlemail.com>
Sun, 10 Jan 2010 15:00:40 +0000 (15:00 +0000)
committerAndreas Fink <andreas.fink85@googlemail.com>
Sun, 10 Jan 2010 15:00:40 +0000 (15:00 +0000)
*fix* do not use g_ptr_array_unref since not everybody has glib-2.22 ;)

src/systray/systraybar.c
src/taskbar/task.c
src/taskbar/taskbar.c
src/tint.c
src/util/window.c

index 86383ab7c66b2cc8a88898e6284d0e14be2ac1a3..bd36ffbee4c64dc11cf7e8f37e7bcef5d4427971 100644 (file)
@@ -102,7 +102,6 @@ void draw_systray(void *obj, cairo_t *c)
                XCopyArea(server.dsp, systray.area.pix, render_background, server.gc, 0, 0, systray.area.width, systray.area.height, 0, 0);
        }
 
-               // tint2 don't draw systray icons. just the background.
        refresh_systray = 1;
 }
 
index 26f8bea759020be1383522c55ac81fa17811b24b..d14f8fa437942176b38d75f9a0c13332a42e94eb 100644 (file)
@@ -443,7 +443,7 @@ void active_task()
        if (w1) {
                Window w2;
                if (XGetTransientForHint(server.dsp, w1, &w2) != 0)
-                       if (w2) w1 = w2;
+                       if (w2 && !task_get_tasks(w1)) w1 = w2;
                set_task_state((task_active = task_get_task(w1)), TASK_ACTIVE);
        }
 }
@@ -456,18 +456,20 @@ void set_task_state(Task *tsk, int state)
 
        if (tsk->current_state != state) {
                GPtrArray* task_group = task_get_tasks(tsk->win);
-               int i;
-               for (i=0; i<task_group->len; ++i) {
-                       Task* tsk1 = g_ptr_array_index(task_group, i);
-                       tsk1->current_state = state;
-                       tsk1->area.bg = panel1[0].g_task.background[state];
-                       tsk1->area.pix = tsk1->state_pix[state];
-                       if (tsk1->state_pix[state] == 0)
-                               tsk1->area.redraw = 1;
-                       if (state == TASK_ACTIVE && g_slist_find(urgent_list, tsk1))
-                               del_urgent(tsk1);
+               if (task_group) {
+                       int i;
+                       for (i=0; i<task_group->len; ++i) {
+                               Task* tsk1 = g_ptr_array_index(task_group, i);
+                               tsk1->current_state = state;
+                               tsk1->area.bg = panel1[0].g_task.background[state];
+                               tsk1->area.pix = tsk1->state_pix[state];
+                               if (tsk1->state_pix[state] == 0)
+                                       tsk1->area.redraw = 1;
+                               if (state == TASK_ACTIVE && g_slist_find(urgent_list, tsk1))
+                                       del_urgent(tsk1);
+                       }
+                       panel_refresh = 1;
                }
-               panel_refresh = 1;
        }
 }
 
index ffc115a3d65b3ad6bce908c2301d06f10cf5b45b..5264fc32c28fa1f9a1fb2221b8d465938144b501 100644 (file)
@@ -37,7 +37,7 @@ GHashTable* win_to_task_table = 0;
 
 guint win_hash(gconstpointer key) { return (guint)*((Window*)key); }
 gboolean win_compare(gconstpointer a, gconstpointer b) { return (*((Window*)a) == *((Window*)b)); }
-
+void free_ptr_array(gpointer* data) { g_ptr_array_free(data, 1); }
 
 void init_taskbar()
 {
@@ -45,7 +45,7 @@ void init_taskbar()
        int i, j;
 
        if (win_to_task_table == 0)
-               win_to_task_table = g_hash_table_new_full(win_hash, win_compare, free, g_ptr_array_unref);
+               win_to_task_table = g_hash_table_new_full(win_hash, win_compare, free, free_ptr_array);
 
        for (i=0 ; i < nb_panel ; i++) {
                panel = &panel1[i];
index 5b042a87e4aef59df8a6d1bd3d30378271ea961a..005be632814999af7ca5f25995643211bc5527a5 100644 (file)
@@ -310,6 +310,7 @@ void event_button_release (XEvent *e)
 
        if (wm_menu && !tint2_handles_click(panel, &e->xbutton)) {
                forward_click(e);
+               XLowerWindow (server.dsp, panel->main_win);
                task_drag = 0;
                return;
        }
@@ -587,7 +588,7 @@ void event_configure_notify (Window win)
        Panel *p = tsk->area.panel;
        if (p->monitor != window_get_monitor (win)) {
                remove_task (tsk);
-               add_task (win);
+               tsk = add_task (win);
                if (win == window_get_active ()) {
                        set_task_state(tsk, TASK_ACTIVE);
                        task_active = tsk;
index caa293438e8cab0ab11a704048beaad5745b8dab..285d525d8e15edbddf23964978ddbd724cafd4a7 100644 (file)
@@ -88,7 +88,7 @@ int window_is_hidden (Window win)
                }
                if (at[i] == server.atom._NET_WM_STATE_MODAL) {
                        // do not add modal windows if the transient window is already in the taskbar
-                       if ( XGetTransientForHint(server.dsp, win, &window) && task_get_task(window) ) {
+                       if ( XGetTransientForHint(server.dsp, win, &window) && task_get_tasks(window) ) {
                                XFree(at);
                                return 1;
                        }
This page took 0.028463 seconds and 4 git commands to generate.