Fix unhiding panel if it becomes empty and height_when_hidden is 0.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Tue, 23 Sep 2014 10:02:09 +0000 (13:02 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Tue, 23 Sep 2014 10:02:09 +0000 (13:02 +0300)
gtk_widget_show() does not work because it is an empty container ATM.
Therefore gtk_widget_queue_resize() should be used as well.

ChangeLog
src/panel.c

index 4bb099a..fcf7c27 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+* Fixed unhiding panel if it becomes empty and height_when_hidden is 0.
+
+0.7.1
+-------------------------------------------------------------------------
 * Fixed search for the gtkrc file.
 * Fixed search path for configuration - it should be not compilation time
     path but paths using $XDG_CONFIG_DIRS.
index 57488b3..ee61197 100644 (file)
@@ -691,11 +691,13 @@ mouse_watch(LXPanel *panel)
 
     gint cx, cy, cw, ch, gap;
 
-    cx = p->cx;
-    cy = p->cy;
+    cx = p->ax;
+    cy = p->ay;
     cw = p->cw;
     ch = p->ch;
 
+    if (cw == 1) cw = 0;
+    if (ch == 1) ch = 0;
     /* reduce area which will raise panel so it does not interfere with apps */
     if (p->ah_state == AH_STATE_HIDDEN) {
         gap = MAX(p->height_when_hidden, GAP);
@@ -743,10 +745,13 @@ static void ah_state_set(LXPanel *panel, PanelAHState ah_state)
         case AH_STATE_VISIBLE:
             gtk_widget_show(GTK_WIDGET(panel));
             gtk_widget_show(p->box);
+            gtk_widget_queue_resize(GTK_WIDGET(panel));
             gtk_window_stick(GTK_WINDOW(panel));
             p->visible = TRUE;
             break;
         case AH_STATE_WAITING:
+            if (p->hide_timeout)
+                g_source_remove(p->hide_timeout);
             p->hide_timeout = g_timeout_add(2 * PERIOD, ah_state_hide_timeout, panel);
             break;
         case AH_STATE_HIDDEN: