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 755097 - wayland: A couple of HiDPI window geometry fixes
wayland: A couple of HiDPI window geometry fixes
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2015-09-16 08:08 UTC by Jonas Ådahl
Modified: 2021-07-05 13:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Scale unconstrained rect changing monitor scale (1.11 KB, patch)
2015-09-16 08:08 UTC, Jonas Ådahl
committed Details | Review
wayland: Scale saved rect changing monitor scale (1.20 KB, patch)
2015-09-16 08:08 UTC, Jonas Ådahl
committed Details | Review

Description Jonas Ådahl 2015-09-16 08:08:11 UTC
"unconstrained_rect" and "saved_rect" were left as-is when the "rect" changed given a new main monitor scale the window got. These two patches fixes this by also scaling these rectangles at the same time.
Comment 1 Jonas Ådahl 2015-09-16 08:08:16 UTC
Created attachment 311435 [details] [review]
wayland: Scale unconstrained rect changing monitor scale

When a window is moved across monitors with different scales, its
rectangle is scaled accordingly. We also need to scale the
unconstrained_rect rectangle, so that moving a window via
meta_window_move_resize() which uses the unconstrained_rect.
Comment 2 Jonas Ådahl 2015-09-16 08:08:21 UTC
Created attachment 311436 [details] [review]
wayland: Scale saved rect changing monitor scale

The saved rect is used to restore a saved window size. We need to
update this when the window is moved to a monitor with different scale,
so that if we unmaximize a window which was moved to a different
monitor while maximized (for example when unplugged) will restore to
the correct size.
Comment 3 Owen Taylor 2015-09-21 14:37:36 UTC
Review of attachment 311435 [details] [review]:

Looks good
Comment 4 Owen Taylor 2015-09-21 14:42:58 UTC
Review of attachment 311436 [details] [review]:

I think this is right. What I wondered is if in some cases moving a maximized window to another monitor might leave the saved_rect on the old monitor - in which case scaling it would be wrong. But:

 - Dragging a window to a new monitor necessarily unmaximizes it
 - Using a keybinding to move a window to a new monitor goes through meta_window_move_to_monitor() => meta_window_move_between_rects() updating the saved rect
 - Changes to the output layout go through meta_window_update_for_monitors_changed() which also goes through meta_window_move_between_rects()

It doesn't feel absolutely rock-solid - there possibly should be some sort of enforcement that saved_rect is always on the same monitor - but I think it's good ehough.
Comment 5 Jonas Ådahl 2015-09-24 03:41:24 UTC
Pushing the attached patches, but not marking as fixed, given the above comment.


Attachment 311435 [details] pushed as bc9e63d - wayland: Scale unconstrained rect changing monitor scale
Attachment 311436 [details] pushed as a9df4bb - wayland: Scale saved rect changing monitor scale
Comment 6 GNOME Infrastructure Team 2021-07-05 13:46:13 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/mutter/-/issues/

Thank you for your understanding and your help.