Wayland: Fix crash when enabling disabling monitors on sway
When an output is unregistered, the corresponding monitor object should be removed from every windows' monitor list Proper fix for #1696
This commit is contained in:
parent
3c7a71772c
commit
e846bc9308
@ -43,6 +43,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
|||||||
server side window decorations, such a GNOME or Weston not working
|
server side window decorations, such a GNOME or Weston not working
|
||||||
correctly (:iss:`1659`)
|
correctly (:iss:`1659`)
|
||||||
|
|
||||||
|
- Wayland: Fix crash when enabling disabling monitors on sway (:iss:`1696`)
|
||||||
|
|
||||||
|
|
||||||
0.14.1 [2019-05-29]
|
0.14.1 [2019-05-29]
|
||||||
---------------------
|
---------------------
|
||||||
|
|||||||
10
glfw/wl_init.c
vendored
10
glfw/wl_init.c
vendored
@ -613,14 +613,20 @@ static void registryHandleGlobalRemove(void *data,
|
|||||||
struct wl_registry *registry,
|
struct wl_registry *registry,
|
||||||
uint32_t name)
|
uint32_t name)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
_GLFWmonitor* monitor;
|
_GLFWmonitor* monitor;
|
||||||
|
|
||||||
for (i = 0; i < _glfw.monitorCount; ++i)
|
for (int i = 0; i < _glfw.monitorCount; ++i)
|
||||||
{
|
{
|
||||||
monitor = _glfw.monitors[i];
|
monitor = _glfw.monitors[i];
|
||||||
if (monitor->wl.name == name)
|
if (monitor->wl.name == name)
|
||||||
{
|
{
|
||||||
|
for (_GLFWwindow *window = _glfw.windowListHead; window; window = window->next) {
|
||||||
|
for (int m = window->wl.monitorsCount - 1; m >= 0; m--) {
|
||||||
|
if (window->wl.monitors[m] == monitor) {
|
||||||
|
remove_i_from_array(window->wl.monitors, m, window->wl.monitorsCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
_glfwInputMonitor(monitor, GLFW_DISCONNECTED, 0);
|
_glfwInputMonitor(monitor, GLFW_DISCONNECTED, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user