diff options
author | Maxim Ermilov <[email protected]> | 2014-09-27 17:43:54 +0300 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2018-08-28 09:38:37 -0400 |
commit | 37fecf49392eb10ada1f4bf481d6ad6be56891dd (patch) | |
tree | 77e7190c06f6590a11ff305ce4066daba9825851 /src/core/display.c | |
parent | 4f47c5be61320102120fcae6c8c04f63c5b4f5b5 (diff) | |
download | marco-37fecf49392eb10ada1f4bf481d6ad6be56891dd.tar.bz2 marco-37fecf49392eb10ada1f4bf481d6ad6be56891dd.tar.xz |
Optionally attach modal dialogs
Add a preference /apps/mutter/general/attach_modal_dialogs. When
true, instead of having independent titlebars, modal dialogs appear
attached to the titlebar of the parent window and are moved
together with the parent window.
https://bugzilla.gnome.org/show_bug.cgi?id=612726
NOTE: Patch copied from mutter and adapted for metacity.
Diffstat (limited to 'src/core/display.c')
-rw-r--r-- | src/core/display.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/core/display.c b/src/core/display.c index 6dd13419..fd5dc545 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -5216,6 +5216,34 @@ prefs_changed_callback (MetaPreference pref, else disable_compositor (display); } + else if (pref == META_PREF_ATTACH_MODAL_DIALOGS) + { + MetaDisplay *display = data; + GSList *windows; + GSList *tmp; + + windows = meta_display_list_windows (display); + + for (tmp = windows; tmp != NULL; tmp = tmp->next) + { + MetaWindow *w = tmp->data; + MetaWindow *parent = meta_window_get_transient_for (w); + meta_window_recalc_features (w); + + if (w->type == META_WINDOW_MODAL_DIALOG && parent && parent != w) + { + int x, y; + /* Forcing a call to move_resize() does two things: first, it handles + * resizing the dialog frame window to the correct size when we remove + * or add the decorations. Second, it will take care of positioning the + * dialog as "attached" to the parent when we turn the preference on + * via the constrain_modal_dialog() constraint. + **/ + meta_window_get_position (w, &x, &y); + meta_window_move (w, FALSE, x, y); + } + } + } } void |