From 9c8cf04a8001b6d1a9be50a10a85ad32795dab69 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 7 Jun 2019 13:38:44 +0530 Subject: [PATCH] Wayland: Don't insert the same monitor twice if the done event for an output is sent twice --- glfw/wl_monitor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glfw/wl_monitor.c b/glfw/wl_monitor.c index bdcb9ca59..910ec5411 100644 --- a/glfw/wl_monitor.c +++ b/glfw/wl_monitor.c @@ -85,6 +85,9 @@ static void outputHandleMode(void* data, static void outputHandleDone(void* data, struct wl_output* output) { struct _GLFWmonitor *monitor = data; + for (int i = 0; i < _glfw.monitorCount; i++) { + if (_glfw.monitors[i] == monitor) return; + } _glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST); }