]> Dogcows Code - chaz/tint2/commitdiff
fixed issue 176
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Wed, 16 Dec 2009 09:04:50 +0000 (09:04 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Wed, 16 Dec 2009 09:04:50 +0000 (09:04 +0000)
src/panel.c
src/server.c
src/tint.c
src/tooltip/tooltip.c

index 52ae61b6096e43131edd28a0c90772f4fd8bd4e5..50aa5c38bf175e0779afff8e9fca4d844572d54a 100644 (file)
@@ -58,7 +58,7 @@ int  max_tick_urgent;
 // panel's initial config
 Panel panel_config;
 // panels (one panel per monitor)
-Panel *panel1 = NULL;
+Panel *panel1 = 0;
 int  nb_panel = 0;
 
 Imlib_Image default_icon = NULL;
@@ -113,11 +113,12 @@ void init_panel()
                new_panel[i].main_win = old_win;
        }
 
-       fprintf(stderr, "tint2 : nb monitor %d, nb desktop %d\n", nb_panel, server.nb_desktop);
+       fprintf(stderr, "tint2 : nb monitor %d, nb monitor used %d, nb desktop %d\n", server.nb_monitor, nb_panel, server.nb_desktop);
        for (i=0 ; i < nb_panel ; i++) {
                p = &new_panel[i];
 
-               p->monitor = i;
+               if (panel_config.monitor < 0)
+                       p->monitor = i;
                p->area.parent = p;
                p->area.panel = p;
                p->area.on_screen = 1;
@@ -263,8 +264,11 @@ void cleanup_panel()
                }
        }
 
-       if (panel1) free(panel1);
-       panel1 = 0;
+       if (panel1) {
+               free(panel1);
+               panel1 = 0;
+               nb_panel = 0;
+       }
 
        if (panel_config.g_task.font_desc) {
                pango_font_description_free(panel_config.g_task.font_desc);
index 56a12446114c7fca1cdbb16670788c844e3b2a19..511eca5d49bbb51f2614a06ac225a2a0b8db7939 100644 (file)
@@ -266,8 +266,7 @@ void get_monitors()
                        }
 next:
                        server.nb_monitor = i;
-                       server.monitor = realloc(server.monitor, server.nb_monitor * sizeof(Monitor));                  
-                       //printf("  nbmonitor %d\n", server.nb_monitor);
+                       server.monitor = realloc(server.monitor, server.nb_monitor * sizeof(Monitor));
                        qsort(server.monitor, server.nb_monitor, sizeof(Monitor), compareMonitorPos);
                }
        }
index ca8f4ffbf7dacdc4a35274d9d6152f181e25d478..fd30d39f2f606e032dfa1b37c5df3970e53d4ff5 100644 (file)
@@ -739,9 +739,8 @@ int main (int argc, char *argv[])
                                                if (!g_tooltip.enabled) break;
                                                Panel* panel = get_panel(e.xmotion.window);
                                                Area* area = click_area(panel, e.xmotion.x, e.xmotion.y);
-                                               if (area->_get_tooltip_text) {
+                                               if (area->_get_tooltip_text)
                                                        tooltip_trigger_show(area, panel, e.xmotion.x_root, e.xmotion.y_root);
-                                               }
                                                else
                                                        tooltip_trigger_hide();
                                                break;
index 06a67d3b441effa86732f7fb43ca5626e6ea2a8f..6d27ec06fc50c683502b73ce8ba5fd2279e0f512 100644 (file)
@@ -102,6 +102,7 @@ void tooltip_trigger_show(Area* area, Panel* p, int x_root, int y_root)
        }
        else if (!g_tooltip.mapped) {
                start_show_timeout();
+               //printf("!g_tooltip.mapped %d %d\n", x, y);
        }
 }
 
@@ -272,10 +273,12 @@ void start_show_timeout()
 {
        reset_timer(g_tooltip.hide_timer_id, 0, 0, 0, 0);
        struct timespec t = g_tooltip.show_timeout;
-       if (t.tv_sec == 0 && t.tv_nsec == 0)
+       if (t.tv_sec == 0 && t.tv_nsec == 0) {
                tooltip_show();
-       else
+       }
+       else {
                reset_timer(g_tooltip.show_timer_id, t.tv_sec, t.tv_nsec, 0, 0);
+       }
 }
 
 
This page took 0.033086 seconds and 4 git commands to generate.