[mutter] window: Handle changes of the attach-modal-dialogs preference



commit eb1292ea994301c312e499bf657e1c3ee4dc843e
Author: Florian MÃllner <fmuellner gnome org>
Date:   Sat Jul 14 00:22:51 2012 +0200

    window: Handle changes of the attach-modal-dialogs preference
    
    Currently we decide whether a modal dialog should be attached or not
    when mapping it, i.e. we don't pick up preference changes that happen
    while the dialog is up. It's not really a big deal given that modal
    dialogs are usually transitory, but it's easy enough to add a bit of
    extra polish ...
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679904

 src/core/window.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index c11720b..93422aa 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -198,12 +198,18 @@ prefs_changed_callback (MetaPreference pref,
 {
   MetaWindow *window = data;
 
-  if (pref != META_PREF_WORKSPACES_ONLY_ON_PRIMARY)
-    return;
-
-  meta_window_update_on_all_workspaces (window);
-
-  meta_window_queue (window, META_QUEUE_CALC_SHOWING);
+  if (pref == META_PREF_WORKSPACES_ONLY_ON_PRIMARY)
+    {
+      meta_window_update_on_all_workspaces (window);
+      meta_window_queue (window, META_QUEUE_CALC_SHOWING);
+    }
+  else if (pref == META_PREF_ATTACH_MODAL_DIALOGS &&
+           window->type == META_WINDOW_MODAL_DIALOG)
+    {
+      window->attached = meta_window_should_attach_to_parent (window);
+      recalc_window_features (window);
+      meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
+    }
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]