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
This commit is contained in:
Florian Müllner
2012-07-03 22:30:02 +02:00
parent fe942049da
commit 0fe0534c85
2 changed files with 7 additions and 11 deletions

View File

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