wayland: Add support for xdg-output

Previously, the GDK backend for Wayland would deduce the logical size
of the monitors from the wl_output size and scale.

With the addition of fractional scaling which advertises a larger scale
value and then scale down the client surface, the computed logical size
of the monitors in GDK would be wrong and confuse applications which
insist on using the monitor size and position (like Firefox).

The xdg-output protocol aims at describing outputs in a way which is more
in line with the concept of an output on desktop oriented systems by
presenting the outputs using their logical size and position appropriately
transformed.

Add support for the optional xdg-output protocol so that the size and
position of the monitors as reported by GDK is correct even when using
fractional scaling.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1828
This commit is contained in:
Olivier Fourdan
2019-04-12 15:14:50 +02:00
parent 81c8efc863
commit 1f64689c31
7 changed files with 176 additions and 37 deletions

View File

@ -227,6 +227,8 @@ struct wl_output *_gdk_wayland_screen_get_wl_output (GdkScreen *screen,
void _gdk_wayland_screen_set_has_gtk_shell (GdkScreen *screen);
void _gdk_wayland_screen_init_xdg_output (GdkScreen *screen);
void _gdk_wayland_window_set_grab_seat (GdkWindow *window,
GdkSeat *seat);