[Xfce4-commits] <xfce4-panel:andrzejr/deskbar-libxfce4panel> xfce-panel-plugin: propagating nrows property changes.

Andrzej noreply at xfce.org
Mon Dec 12 18:20:01 CET 2011


Updating branch refs/heads/andrzejr/deskbar-libxfce4panel
         to 05fbf8c336644057581b697238a015a1bec5507c (commit)
       from ceefb69cc4753ff3cd0fe7a6265b54d92b915b89 (commit)

commit 05fbf8c336644057581b697238a015a1bec5507c
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Tue Dec 13 01:25:56 2011 +0900

    xfce-panel-plugin: propagating nrows property changes.
    
    The "if" clause in the xfce_panel_plugin_set_size was always FALSE when the procedure was called from xfce_panel_plugin_set_nrows.

 libxfce4panel/xfce-panel-plugin.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c
index e3dd378..423590b 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -1363,7 +1363,7 @@ xfce_panel_plugin_set_size (XfcePanelPluginProvider *provider,
   real_size = size * plugin->priv->nrows;
 
   /* check if update is required */
-  if (G_LIKELY (plugin->priv->size * plugin->priv->nrows != real_size))
+  if (G_LIKELY (plugin->priv->size * (gint) plugin->priv->nrows != real_size))
     {
       plugin->priv->size = size;
 
@@ -1421,6 +1421,8 @@ xfce_panel_plugin_set_nrows (XfcePanelPluginProvider *provider,
                              guint                    nrows)
 {
   XfcePanelPlugin *plugin = XFCE_PANEL_PLUGIN (provider);
+  gboolean         handled = FALSE;
+  gint             real_size;
 
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (provider));
 
@@ -1437,7 +1439,16 @@ 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);
+      real_size = plugin->priv->size * nrows;
+
+      g_signal_emit (G_OBJECT (plugin),
+                     plugin_signals[SIZE_CHANGED], 0, real_size, &handled);
+
+      /* handle the size when not done by the plugin */
+      if (!handled)
+        gtk_widget_set_size_request (GTK_WIDGET (plugin), real_size, real_size);
+
+      g_object_notify (G_OBJECT (plugin), "size");
     }
 }
 


More information about the Xfce4-commits mailing list