From 5500c2b3a8fefade1644ba02ff8bfdea57d63c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 21 Mar 2011 18:23:53 +0100 Subject: [PATCH] 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 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/core/window.c b/src/core/window.c index 99650f5c8..1aa13c5b3 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;