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

Nick Schermer noreply at xfce.org
Mon Dec 12 20:02:06 CET 2011


Updating branch refs/heads/nick/desktop-mode
         to 0bbaf53615800b05cfceb9865dafc45a6d633a21 (commit)
       from 0ad68b7861c6a9122df65226ca1501f6193c1ba4 (commit)

commit 0bbaf53615800b05cfceb9865dafc45a6d633a21
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