After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773141 - constraints: Use ConstraintInfo window rect when placing
constraints: Use ConstraintInfo window rect when placing
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2016-10-18 09:11 UTC by Jonas Ådahl
Modified: 2016-10-19 07:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
constraints: Use ConstraintInfo window rect when placing (1.35 KB, patch)
2016-10-18 09:11 UTC, Jonas Ådahl
committed Details | Review

Description Jonas Ådahl 2016-10-18 09:11:51 UTC
This fixes for exampling opening a File menu on a window maximized on a second monitor.
Comment 1 Jonas Ådahl 2016-10-18 09:11:55 UTC
Created attachment 337922 [details] [review]
constraints: Use ConstraintInfo window rect when placing

The frame rect will at this point 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
canstraining, 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 on a the monitor relative X position 0
on a non-right-most monitor on Wayland.
Comment 2 Rui Matos 2016-10-18 16:51:32 UTC
Review of attachment 337922 [details] [review]:

I think you mean "the frame rect will at this point be *unset* for wayland popups" and that last sentence in the commit message is kinda hard to parse.

::: src/core/constraints.c
@@ +466,3 @@
       const MetaMonitorInfo *monitor_info;
 
+      placed_rect = info->current;

To keep it as close as possible as it was, we could use x,y from get_frame_rect() and only width,height from info->current which would still fix this issue.

That said, I think this is safe enough.
Comment 3 Jonas Ådahl 2016-10-19 07:15:27 UTC
Pushed with the changes suggested during review.