mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Wayland: Fix duplicate monitor connection events
GLFW would report a monitor as connected each time its wl_output
received an update, for example if its scale changed.
This would also cause the monitor to be added to the monitor array
again, causing glfwTerminate to segfault when it attempted to destroy
its already destroyed wl_output.
(cherry picked from commit c3ad3d49ed
)
This commit is contained in:
parent
50ea41cb04
commit
557da4cdc4
@ -168,6 +168,10 @@ information on what to include when reporting a bug.
|
|||||||
- [Wayland] Bugfix: Size limits included frame size for fallback decorations
|
- [Wayland] Bugfix: Size limits included frame size for fallback decorations
|
||||||
- [Wayland] Bugfix: Updating `GLFW_DECORATED` had no effect on server-side
|
- [Wayland] Bugfix: Updating `GLFW_DECORATED` had no effect on server-side
|
||||||
decorations
|
decorations
|
||||||
|
- [Wayland] Bugfix: A monitor would be reported as connected again if its scale
|
||||||
|
changed
|
||||||
|
- [Wayland] Bugfix: `glfwTerminate` would segfault if any monitor had changed
|
||||||
|
scale
|
||||||
|
|
||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
|
@ -95,6 +95,12 @@ static void outputHandleDone(void* userData, struct wl_output* output)
|
|||||||
monitor->heightMM = (int) (mode->height * 25.4f / 96.f);
|
monitor->heightMM = (int) (mode->height * 25.4f / 96.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < _glfw.monitorCount; i++)
|
||||||
|
{
|
||||||
|
if (_glfw.monitors[i] == monitor)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST);
|
_glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user