|
@@ -88,6 +88,14 @@ static void outputHandleDone(void* data, struct wl_output* output)
|
|
{
|
|
{
|
|
struct _GLFWmonitor *monitor = data;
|
|
struct _GLFWmonitor *monitor = data;
|
|
|
|
|
|
|
|
+ if (monitor->widthMM <= 0 || monitor->heightMM <= 0)
|
|
|
|
+ {
|
|
|
|
+ // If Wayland does not provide a physical size, assume the default 96 DPI
|
|
|
|
+ const GLFWvidmode* mode = &monitor->modes[monitor->wl.currentMode];
|
|
|
|
+ monitor->widthMM = (int) (mode->width * 25.4f / 96.f);
|
|
|
|
+ monitor->heightMM = (int) (mode->height * 25.4f / 96.f);
|
|
|
|
+ }
|
|
|
|
+
|
|
_glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST);
|
|
_glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST);
|
|
}
|
|
}
|
|
|
|
|