[gtk/wip/Jehan/wrong-monitor-wayland] gdk: Wayland output `done()` listener not scale factor aware.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/Jehan/wrong-monitor-wayland] gdk: Wayland output `done()` listener not scale factor aware.
- Date: Mon, 22 Jun 2020 07:06:41 +0000 (UTC)
commit 199d9c92a0a1b9f6c6f41e52fe867cfba2d23ed7
Author: Jehan <jehan girinstud io>
Date: Sun Jun 21 18:32:30 2020 +0200
gdk: Wayland output `done()` listener not scale factor aware.
As can be seen on other Wayland handlers, GdkWaylandMonitor width and
height are in device pixels whereas we are saving GdkMonitor size in
application pixels.
gdk/wayland/gdkscreen-wayland.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
index cb60d3a0fd..dc87e7a306 100644
--- a/gdk/wayland/gdkscreen-wayland.c
+++ b/gdk/wayland/gdkscreen-wayland.c
@@ -1607,12 +1607,17 @@ output_handle_done (void *data,
struct wl_output *wl_output)
{
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
+ int scale;
GDK_NOTE (MISC,
g_message ("handle done output %d", monitor->id));
monitor->wl_output_done = TRUE;
+ scale = gdk_monitor_get_scale_factor (GDK_MONITOR (monitor));
+ monitor->width = monitor->width / scale;
+ monitor->height = monitor->height / scale;
+
if (!should_expect_xdg_output_done (monitor) || monitor->xdg_output_done)
apply_monitor_change (monitor);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]