Skip to content

Wip/jehan/wrong monitor wayland

Jehan requested to merge wip/Jehan/wrong-monitor-wayland into gtk-3-24

On GIMP on Wayland, our splash screen was taking full monitor size with scale ratio 2. I was wondering why it was, because we had explicit code to never make the splah image more than half the width or height.

So after looking into GDK code, I found that the culprit was that gdk_monitor_get_workarea() was returning a height area of exactly the monitor real pixel size on Wayland, while it was half the size on X11. Considering that the function documentation explicitly says:

The returned geometry is in ”application pixels”, not in ”device pixels”

The returned value in X11 is the right one (because with a scale ratio of 2, application geometry is divided by 2) and the bug was on the Wayland implementation.

The proposed patch fixes the bug, as there is indeed some code path where we save a GdkWaylandMonitor geometry without dividing it by scale ratio (in other places, this is done).

Edited by Jonas Ådahl

Merge request reports