summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2012-07-03 22:30:02 +0200
committerFlorian Müllner <fmuellner@gnome.org>2012-07-14 03:30:56 +0200
commit0fe0534c85a839f381367a75683c92095801d06e (patch)
treec87f3f4a2d7b8723e60c1cf8e4ca86155b75deae
parentfe942049dafe5404cae30b91794cec2b44dd9bc1 (diff)
downloadmutter-0fe0534c85a839f381367a75683c92095801d06e.tar.gz
constraints: Center modal dialogs on their parent
... rather than attaching them to the parent's title bar. https://bugzilla.gnome.org/show_bug.cgi?id=674499
-rw-r--r--src/core/constraints.c9
-rw-r--r--src/core/window.c9
2 files changed, 7 insertions, 11 deletions
diff --git a/src/core/constraints.c b/src/core/constraints.c
index d555ec9f0..eb1464754 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -764,21 +764,14 @@ constrain_modal_dialog (MetaWindow *window,
return TRUE;
x = parent->rect.x + (parent->rect.width / 2 - info->current.width / 2);
- y = 0;
+ y = parent->rect.y + (parent->rect.height / 2 - info->current.height / 2);
if (parent->frame)
{
MetaFrameBorders borders;
x += parent->frame->rect.x;
y += parent->frame->rect.y;
-
- meta_frame_calc_borders (parent->frame, &borders);
- y += borders.total.top;
-
- y += info->borders->visible.top;
}
- else
- y = parent->rect.y + info->borders->visible.top;
constraint_already_satisfied = (x == info->current.x) && (y == info->current.y);
diff --git a/src/core/window.c b/src/core/window.c
index bc119a204..c11720b08 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -8917,12 +8917,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
+ /* Attached modal dialogs are special in that size
+ * changes apply to both sides, so that the dialog
* remains centered to the parent.
*/
if (meta_window_is_attached_dialog (window))
- dx *= 2;
+ {
+ dx *= 2;
+ dy *= 2;
+ }
new_w = window->display->grab_anchor_window_pos.width;
new_h = window->display->grab_anchor_window_pos.height;