diff options
author | Sebastian Wick <sebastian.wick@redhat.com> | 2022-11-28 17:41:52 +0100 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2022-12-17 10:09:37 +0000 |
commit | a2ed0f97c37c552d4e288933529a0a4f9936d1d9 (patch) | |
tree | 6a4d643afd9c8a5f2ef8f513c7639228ae33d2e5 | |
parent | 753c7685780829ebf684ce8ec51b434ff3e4ac95 (diff) | |
download | mutter-a2ed0f97c37c552d4e288933529a0a4f9936d1d9.tar.gz |
wayland/outputs: Make wl_output mode independent of the orientation
wl_output describes the physical attributes and the mode of an output is
such a physical attribute. Swapping the width and height creates
another, incorrect mode.
Other compositors also report the physical mode and don't try to
transform it based on the orientation of buffers.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2519
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2723>
-rw-r--r-- | src/wayland/meta-wayland-outputs.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c index c2ed5986b..dfd21a37f 100644 --- a/src/wayland/meta-wayland-outputs.c +++ b/src/wayland/meta-wayland-outputs.c @@ -144,23 +144,6 @@ calculate_wayland_output_scale (MetaMonitor *monitor) return ceilf (scale); } -static void -get_native_output_mode_resolution (MetaMonitor *monitor, - MetaMonitorMode *mode, - int *mode_width, - int *mode_height) -{ - MetaLogicalMonitor *logical_monitor; - MetaMonitorTransform transform; - - logical_monitor = meta_monitor_get_logical_monitor (monitor); - transform = meta_logical_monitor_get_transform (logical_monitor); - if (meta_monitor_transform_is_rotated (transform)) - meta_monitor_mode_get_resolution (mode, mode_height, mode_width); - else - meta_monitor_mode_get_resolution (mode, mode_width, mode_height); -} - static enum wl_output_transform wl_output_transform_from_transform (MetaMonitorTransform transform) { @@ -259,10 +242,9 @@ send_output_events (struct wl_resource *resource, if (current_mode == preferred_mode) mode_flags |= WL_OUTPUT_MODE_PREFERRED; - get_native_output_mode_resolution (monitor, - current_mode, - &new_width, - &new_height); + meta_monitor_mode_get_resolution (current_mode, + &new_width, + &new_height); if (need_all_events || wayland_output->mode_width != new_width || wayland_output->mode_height != new_height || @@ -383,10 +365,9 @@ meta_wayland_output_set_monitor (MetaWaylandOutput *wayland_output, wayland_output->transform = meta_logical_monitor_get_transform (logical_monitor); - get_native_output_mode_resolution (monitor, - current_mode, - &wayland_output->mode_width, - &wayland_output->mode_height); + meta_monitor_mode_get_resolution (current_mode, + &wayland_output->mode_width, + &wayland_output->mode_height); } static void |