summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-11-15 01:07:42 +0100
committerStefano Karapetsas <[email protected]>2013-11-15 01:07:42 +0100
commit6baad9dafc848b65cc469e03ea12388d98db9cd1 (patch)
tree2f6ed21340e30de5056b2aa467418e9b11a005f7 /applets
parent18f1c77e939af90f5d882a4b3704c86942b6e019 (diff)
downloadmate-panel-6baad9dafc848b65cc469e03ea12388d98db9cd1.tar.bz2
mate-panel-6baad9dafc848b65cc469e03ea12388d98db9cd1.tar.xz
wncklet: Fit window list size with GTK3
Diffstat (limited to 'applets')
-rw-r--r--applets/wncklet/window-list.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c
index fc913617..c48b4e7b 100644
--- a/applets/wncklet/window-list.c
+++ b/applets/wncklet/window-list.c
@@ -329,14 +329,22 @@ static void setup_gsettings(TasklistData* tasklist)
tasklist);
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+static void applet_size_allocate(GtkWidget *widget, GtkAllocation *allocation, TasklistData *tasklist)
+#else
static void applet_size_request(GtkWidget* widget, GtkRequisition* requisition, TasklistData* tasklist)
+#endif
{
int len;
const int* size_hints;
+#if !GTK_CHECK_VERSION (3, 0, 0)
GtkRequisition child_req;
+#endif
WnckTasklist* wncktl = WNCK_TASKLIST(tasklist->tasklist);
+#if !GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_child_requisition(tasklist->applet, &child_req);
+#endif
size_hints = wnck_tasklist_get_size_hint_list(wncktl, &len);
g_assert(len % 2 == 0);
@@ -439,7 +447,11 @@ gboolean window_list_applet_fill(MatePanelApplet* applet)
g_signal_connect(G_OBJECT(tasklist->tasklist), "destroy", G_CALLBACK(destroy_tasklist), tasklist);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ g_signal_connect(G_OBJECT(tasklist->applet), "size_allocate", G_CALLBACK(applet_size_allocate), tasklist);
+#else
g_signal_connect(G_OBJECT(tasklist->applet), "size_request", G_CALLBACK(applet_size_request), tasklist);
+#endif
tasklist_update(tasklist);
gtk_widget_show(tasklist->tasklist);