From f1b58398b0b21d3a4147363a26565b4c02a9a7c9 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 24 Aug 2002 21:49:32 +0000 Subject: [PATCH] recalculate mapped-ness of frame after toggling decorations on/off, so 2002-08-24 Havoc Pennington * src/window.c (process_property_notify): recalculate mapped-ness of frame after toggling decorations on/off, so that windows don't disappear when decorations are toggled on. * src/tools/metacity-window-demo.c (toggle_decorated_cb): add a test for toggling decoration state on the fly --- ChangeLog | 9 +++++++++ src/tools/metacity-window-demo.c | 19 +++++++++++++++++++ src/window.c | 2 ++ 3 files changed, 30 insertions(+) diff --git a/ChangeLog b/ChangeLog index 430853daf..dee69a3ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-08-24 Havoc Pennington + + * src/window.c (process_property_notify): recalculate mapped-ness + of frame after toggling decorations on/off, so that windows don't + disappear when decorations are toggled on. + + * src/tools/metacity-window-demo.c (toggle_decorated_cb): add a + test for toggling decoration state on the fly + 2002-08-24 Havoc Pennington * src/window.c (update_sm_hints): hack around bug in kmail etc. diff --git a/src/tools/metacity-window-demo.c b/src/tools/metacity-window-demo.c index 6afa569e7..ca75e2ee9 100644 --- a/src/tools/metacity-window-demo.c +++ b/src/tools/metacity-window-demo.c @@ -634,6 +634,17 @@ sleep_cb (GtkWidget *button, sleep (1000); } +static void +toggle_decorated_cb (GtkWidget *button, + gpointer data) +{ + GtkWidget *window; + window = gtk_widget_get_ancestor (button, GTK_TYPE_WINDOW); + if (window) + gtk_window_set_decorated (GTK_WINDOW (window), + !gtk_window_get_decorated (GTK_WINDOW (window))); +} + static void clicked_toolbar_cb (GtkWidget *button, gpointer data) @@ -779,6 +790,14 @@ do_appwindow (void) window, /* user data for callback */ -1); /* -1 means "append" */ + gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), + GTK_STOCK_OPEN, + "This is a demo button that toggles window decorations", + NULL, + G_CALLBACK (toggle_decorated_cb), + window, /* user data for callback */ + -1); /* -1 means "append" */ + gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), GTK_STOCK_QUIT, "This is a demo button with a 'quit' icon", diff --git a/src/window.c b/src/window.c index 083adc82a..8c3b827d6 100644 --- a/src/window.c +++ b/src/window.c @@ -3794,6 +3794,8 @@ process_property_notify (MetaWindow *window, meta_window_destroy_frame (window); meta_window_queue_move_resize (window); + /* because ensure/destroy frame may unmap */ + meta_window_queue_calc_showing (window); } else if (event->atom == XA_WM_CLASS) {