[metacity] window: Allow resizing of attached modal dialogs
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] window: Allow resizing of attached modal dialogs
- Date: Thu, 2 Mar 2017 22:15:34 +0000 (UTC)
commit c0a297236868ff70a3f1cc9504dab1b410cd25f1
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 | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index ca30d17..185e9e3 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -6647,12 +6647,7 @@ recalc_window_features (MetaWindow *window)
if (window->type == META_WINDOW_MODAL_DIALOG && meta_prefs_get_attach_modal_dialogs ())
{
- 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 ||
@@ -7550,6 +7545,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]