diff options
author | Javier <dev.git@javispedro.com> | 2015-02-15 05:02:33 +0100 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2015-02-15 05:02:33 +0100 |
commit | 7842fd1b3183deaaaea0ff2124b4e5269e5d7ad8 (patch) | |
tree | b4d5be2be515e02a9ad79e873660a3058f7ec946 | |
parent | d82d349daa3fdccbef0186ae19311004c4bb2434 (diff) | |
download | topmenu-gtk-7842fd1b3183deaaaea0ff2124b4e5269e5d7ad8.tar.gz topmenu-gtk-7842fd1b3183deaaaea0ff2124b4e5269e5d7ad8.zip |
force resizing of the plug window
-rw-r--r-- | libtopmenu-server/topmenu-widget.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libtopmenu-server/topmenu-widget.c b/libtopmenu-server/topmenu-widget.c index 762a792..4dbc42b 100644 --- a/libtopmenu-server/topmenu-widget.c +++ b/libtopmenu-server/topmenu-widget.c @@ -194,13 +194,23 @@ static void topmenu_widget_embed_topmenu_window(TopMenuWidget *self, Window wind // Otherwise, disembed the current client g_debug("Disembedding window 0x%lx", GDK_WINDOW_XID(cur)); + gdk_error_trap_push(); gdk_window_hide(cur); // Reparent back to root window to end embedding GdkScreen *screen = gdk_window_get_screen(cur); gdk_window_reparent(cur, gdk_screen_get_root_window(screen), 0, 0); + + gdk_flush(); + if (gdk_error_trap_pop()) { + g_debug("error while disembedding window"); + // Assume it's destroyed, so continue. + } } + g_clear_object(&self->socket->plug_window); + self->socket->current_width = self->socket->current_height = 0; + if (window) { g_debug("Embedding window 0x%lx", window); gtk_socket_add_id(self->socket, window); @@ -406,10 +416,11 @@ static void topmenu_widget_unmap(GtkWidget *widget) static void topmenu_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { TopMenuWidget *self = TOPMENU_WIDGET(widget); + GTK_WIDGET_CLASS(topmenu_widget_parent_class)->size_allocate(widget, allocation); if (self->socket) { + self->socket->current_width = self->socket->current_height = 0; gtk_widget_size_allocate(GTK_WIDGET(self->socket), allocation); } - GTK_WIDGET_CLASS(topmenu_widget_parent_class)->size_allocate(widget, allocation); } #if GTK_MAJOR_VERSION == 3 |