[Xfce4-commits] <xfce4-panel:nick/gtk3> PanelPlugin: do not rely on set_size_request in Gtk3
Andrzej
noreply at xfce.org
Wed Apr 17 03:30:02 CEST 2013
Updating branch refs/heads/nick/gtk3
to 91f5dd68b05d9890cb3d474e1f6c3595b136f100 (commit)
from a3b73cb278a0ff2d2f939edd5aa9b53860b2812c (commit)
commit 91f5dd68b05d9890cb3d474e1f6c3595b136f100
Author: Andrzej <ndrwrdck at gmail.com>
Date: Tue Apr 16 23:45:55 2013 +0100
PanelPlugin: do not rely on set_size_request in Gtk3
From Gtk3 set_size_request can only increase the size of a widget
(sets a minimum size) so it cannot "force" the plugin to fit in the panel
or panel row.
Instead, we need to implement get_preferred_width/height in the plugin
itself.
libxfce4panel/xfce-panel-plugin.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c
index ce694a6..89e0c88 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -1364,8 +1364,13 @@ xfce_panel_plugin_set_size (XfcePanelPluginProvider *provider,
plugin_signals[SIZE_CHANGED], 0, real_size, &handled);
/* handle the size when not done by the plugin */
+ /* do not use set_size_request in Gtk3 (can only increase size) */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_queue_resize (GTK_WIDGET (plugin));
+#else
if (!handled)
gtk_widget_set_size_request (GTK_WIDGET (plugin), real_size, real_size);
+#endif
g_object_notify_by_pspec (G_OBJECT (plugin), plugin_props[PROP_SIZE]);
}
More information about the Xfce4-commits
mailing list