diff options
-rw-r--r-- | libtopmenu-server/topmenu-widget.c | 8 | ||||
-rw-r--r-- | test/client.c | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/libtopmenu-server/topmenu-widget.c b/libtopmenu-server/topmenu-widget.c index e4c51de..05a2895 100644 --- a/libtopmenu-server/topmenu-widget.c +++ b/libtopmenu-server/topmenu-widget.c @@ -68,7 +68,11 @@ static Window topmenu_widget_get_current_active_window(TopMenuWidget *self) { #ifdef HAVE_MATEWNCK MatewnckWindow *window = matewnck_screen_get_active_window(self->priv->screen); - return matewnck_window_get_xid(window); + if (window) { + return matewnck_window_get_xid(window); + } else { + return None; + } #else return None; #endif @@ -129,7 +133,7 @@ static void topmenu_widget_embed_topmenu_window(TopMenuWidget *self, Window wind } // Otherwise, disembed the current client - g_debug("Pulling the plug"); + g_debug("Disembedding window 0x%lx", GDK_WINDOW_XID(cur)); gdk_window_hide(cur); // Reparent back to root window to end embedding diff --git a/test/client.c b/test/client.c index 8aff036..6334de1 100644 --- a/test/client.c +++ b/test/client.c @@ -49,9 +49,11 @@ GtkWindow * create_main_window() GtkVBox *box = GTK_VBOX(gtk_vbox_new(FALSE, 0)); GtkLabel *label = GTK_LABEL(gtk_label_new("Hello World")); +#if 0 GtkWidget *bar = create_menu_bar(); - gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(bar), FALSE, FALSE, 0); +#endif + gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(label), TRUE, TRUE, 0); gtk_container_add(GTK_CONTAINER(win), GTK_WIDGET(box)); @@ -68,7 +70,7 @@ int main(int argc, char **argv) gtk_widget_realize(GTK_WIDGET(mainwin)); -#if 0 +#if 1 topmenu_client_connect_window_widget(gtk_widget_get_window(GTK_WIDGET(mainwin)), create_menu_bar()); #endif |