File lxpanel-0.7.1-fix-empty-panel-unhide-if-height_when_hidden-is-0.patch of Package lxpanel

From 9a762e63dce20d425345947b7ad4f24ec510db27 Mon Sep 17 00:00:00 2001
From: Andriy Grytsenko <andrej@rep.kiev.ua>
Date: Tue, 23 Sep 2014 13:02:09 +0300
Subject: [PATCH] Fix unhiding panel if it becomes empty and
 height_when_hidden is 0.

gtk_widget_show() does not work because it is an empty container ATM.
Therefore gtk_widget_queue_resize() should be used as well.
---
 ChangeLog   |    4 ++++
 src/panel.c |    9 +++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4bb099a..fcf7c27 100644
--- 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.
diff --git a/src/panel.c b/src/panel.c
index 57488b3..ee61197 100644
--- a/src/panel.c
+++ b/src/panel.c
@@ -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:
-- 
1.7.10.4

openSUSE Build Service is sponsored by