aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2015-02-15 05:06:12 +0100
committerJavier <dev.git@javispedro.com>2015-02-15 05:06:12 +0100
commit8d80b2f167791274dbbcaea267c232b2363c3655 (patch)
treeabdc9a68bb9b8e2c2cc222378c88e28ab181e6d3
parent7842fd1b3183deaaaea0ff2124b4e5269e5d7ad8 (diff)
downloadtopmenu-gtk-8d80b2f167791274dbbcaea267c232b2363c3655.tar.gz
topmenu-gtk-8d80b2f167791274dbbcaea267c232b2363c3655.zip
fix gtk3 build
-rw-r--r--libtopmenu-server/topmenu-widget.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libtopmenu-server/topmenu-widget.c b/libtopmenu-server/topmenu-widget.c
index 4dbc42b..a44ec08 100644
--- a/libtopmenu-server/topmenu-widget.c
+++ b/libtopmenu-server/topmenu-widget.c
@@ -208,8 +208,12 @@ static void topmenu_widget_embed_topmenu_window(TopMenuWidget *self, Window wind
}
}
+#if GTK_VERSION == 2
+ /* Seems that we might be adding the new plug before actually letting
+ * the socket receive the reparentnotify from above. */
g_clear_object(&self->socket->plug_window);
self->socket->current_width = self->socket->current_height = 0;
+#endif
if (window) {
g_debug("Embedding window 0x%lx", window);
@@ -418,7 +422,10 @@ static void topmenu_widget_size_allocate(GtkWidget *widget, GtkAllocation *alloc
TopMenuWidget *self = TOPMENU_WIDGET(widget);
GTK_WIDGET_CLASS(topmenu_widget_parent_class)->size_allocate(widget, allocation);
if (self->socket) {
+#if GTK_VERSION == 2
+ /* Force a resize of the plug window */
self->socket->current_width = self->socket->current_height = 0;
+#endif
gtk_widget_size_allocate(GTK_WIDGET(self->socket), allocation);
}
}