[Xfce4-commits] <xfce4-panel:master> Libxfce4panel: Fix size-changed signal/prop emit.

Nick Schermer noreply at xfce.org
Sat Dec 24 13:10:20 CET 2011


Updating branch refs/heads/master
         to d4210bb2a179f8178ca0c4e6862c86a207ee7586 (commit)
       from 66faf4adb5817b06fa25dd213bcddaddf09d4198 (commit)

commit d4210bb2a179f8178ca0c4e6862c86a207ee7586
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Dec 12 19:58:29 2011 +0100

    Libxfce4panel: Fix size-changed signal/prop emit.

 libxfce4panel/xfce-panel-plugin.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c
index 34a3b5a..80adb0f 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -1360,12 +1360,14 @@ xfce_panel_plugin_set_size (XfcePanelPluginProvider *provider,
 
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (provider));
 
-  real_size = size * plugin->priv->nrows;
-
-  /* check if update is required */
-  if (G_LIKELY (plugin->priv->size != real_size))
+  /* check if update is required, -1 for forced property emit
+   * by xfce_panel_plugin_set_nrows */
+  if (G_LIKELY (plugin->priv->size != size))
     {
-      plugin->priv->size = size;
+      if (size != -1)
+        plugin->priv->size = size;
+
+      real_size = plugin->priv->size * plugin->priv->nrows;
 
       g_signal_emit (G_OBJECT (plugin),
                      plugin_signals[SIZE_CHANGED], 0, real_size, &handled);
@@ -1437,7 +1439,7 @@ xfce_panel_plugin_set_nrows (XfcePanelPluginProvider *provider,
       g_object_notify (G_OBJECT (plugin), "nrows");
 
       /* also the size changed */
-      xfce_panel_plugin_set_size (provider, plugin->priv->size);
+      xfce_panel_plugin_set_size (provider, -1);
     }
 }
 


More information about the Xfce4-commits mailing list