constraints: Use ConstraintInfo window size when placing

The frame rect will at this point not be set for Wayland popups, since
the popup is placed and constrained before the actual buffer will be
attached. To still be able to calculate a proper monitor to be used for
constraining, use the ConstraintInfo::current dimensions instead, since
they will have the expected size. This should not cause any issues with
present paths since when a window is otherwise placed, it usually
doesn't change monitor calculation result.

This fixes opening a popup menu that would be positioned on the left
edge of a not-left-most monitor, for example a 'File' menu on a window
maximized on a second monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=773141
This commit is contained in:
Jonas Ådahl 2016-10-18 16:28:18 +08:00
parent 1d4a5a7520
commit 8b0e9706ca

View File

@ -465,7 +465,12 @@ place_window_if_needed(MetaWindow *window,
MetaWorkspace *cur_workspace; MetaWorkspace *cur_workspace;
const MetaMonitorInfo *monitor_info; const MetaMonitorInfo *monitor_info;
meta_window_get_frame_rect (window, &placed_rect); placed_rect = (MetaRectangle) {
.x = window->rect.x,
.y = window->rect.y,
.width = info->current.width,
.height = info->current.height
};
orig_rect = info->orig; orig_rect = info->orig;