Wayland: Implement HiDPI support

Windows now keep track of the monitors they are on, so we can calculate
the best scaling factor for them, by using the maximum of each of the
monitors.

The compositor scales down the buffer automatically when it is on a
lower density monitor, instead of the previous way where it was scaling
up the buffer on higher density monitors, which makes the application
look much better on those ones.
This commit is contained in:
Emmanuel Gil Peyrot
2015-10-10 16:35:06 +01:00
committed by Jonas Ådahl
parent ecd04539ec
commit 06479ba535
4 changed files with 111 additions and 3 deletions
+5
View File
@@ -97,6 +97,9 @@ static void scale(void* data,
struct wl_output* output,
int32_t factor)
{
struct _GLFWmonitor *monitor = data;
monitor->wl.scale = factor;
}
static const struct wl_output_listener output_listener = {
@@ -142,6 +145,8 @@ void _glfwAddOutputWayland(uint32_t name, uint32_t version)
monitor->wl.modes = calloc(4, sizeof(_GLFWvidmodeWayland));
monitor->wl.modesSize = 4;
monitor->wl.scale = 1;
monitor->wl.output = output;
wl_output_add_listener(output, &output_listener, monitor);