Wayland: Handle monitor removal

master
Emmanuel Gil Peyrot ago%!(EXTRA string=7 years)
parent f67b610dd4
commit d6b9d00ceb
  1. 12
      src/wl_init.c
  2. 1
      src/wl_monitor.c
  3. 1
      src/wl_platform.h

@ -585,6 +585,18 @@ static void registryHandleGlobalRemove(void *data,
struct wl_registry *registry,
uint32_t name)
{
int i;
_GLFWmonitor* monitor;
for (i = 0; i < _glfw.monitorCount; ++i)
{
monitor = _glfw.monitors[i];
if (monitor->wl.name == name)
{
_glfwInputMonitor(monitor, GLFW_DISCONNECTED, 0);
return;
}
}
}

@ -136,6 +136,7 @@ void _glfwAddOutputWayland(uint32_t name, uint32_t version)
monitor->wl.scale = 1;
monitor->wl.output = output;
monitor->wl.name = name;
wl_output_add_listener(output, &outputListener, monitor);
}

@ -284,6 +284,7 @@ typedef struct _GLFWlibraryWayland
typedef struct _GLFWmonitorWayland
{
struct wl_output* output;
int name;
int currentMode;
int x;

Loading…
Cancel
Save