1
0
Fork 0

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
This commit is contained in:
Florian Müllner 2011-03-21 18:23:53 +01:00
parent 82db52aaf4
commit 5500c2b3a8

View file

@ -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;