summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2016-10-18 16:28:18 +0800
committerJonas Ådahl <jadahl@gmail.com>2016-10-19 15:16:46 +0800
commit1d8bb589903f6ed3a10c222e4818af80b4247f66 (patch)
treeff1670ff6174535eba41b8593fd32b46552d5ccf /src
parent32877118c3d24ca4a7bfbcfaff2ff49c0d0ff5b5 (diff)
downloadmutter-1d8bb589903f6ed3a10c222e4818af80b4247f66.tar.gz
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
Diffstat (limited to 'src')
-rw-r--r--src/core/constraints.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/constraints.c b/src/core/constraints.c
index 7c4d61ada..a9d983e04 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -465,7 +465,12 @@ place_window_if_needed(MetaWindow *window,
MetaWorkspace *cur_workspace;
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;