[mutter] window: Allow resizing of attached modal dialogs



commit 5500c2b3a8fefade1644ba02ff8bfdea57d63c7c
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Mar 21 18:23:53 2011 +0100

    window: Allow resizing of attached modal dialogs
    
    Currently attached modal dialogs are not resizable, but we don't
    communicate this to GTK+, so the dialog may end up with resize
    grips anyway. As a fix, allow resizing, but account for the dialog
    being centered to its parent.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=643597

 src/core/window.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 99650f5..1aa13c5 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -7433,10 +7433,7 @@ recalc_window_features (MetaWindow *window)
     {
       MetaWindow *parent = meta_window_get_transient_for (window);
       if (parent)
-        {
-          window->has_resize_func = FALSE;
-          window->border_only = TRUE;
-        }
+        window->border_only = TRUE;
     }
 
   if (window->type == META_WINDOW_DESKTOP ||
@@ -8423,6 +8420,15 @@ update_resize (MetaWindow *window,
   dx = x - window->display->grab_anchor_root_x;
   dy = y - window->display->grab_anchor_root_y;
 
+  /* Attached modal dialogs are special in that horizontal
+   * size changes apply to both sides, so that the dialog
+   * remains centered to the parent.
+   */
+  if (window->type == META_WINDOW_MODAL_DIALOG &&
+      meta_prefs_get_attach_modal_dialogs () &&
+      meta_window_get_transient_for (window) != NULL)
+    dx *= 2;
+
   new_w = window->display->grab_anchor_window_pos.width;
   new_h = window->display->grab_anchor_window_pos.height;
 



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