From 1ad9c2d5ddc4b8e38b86b4410beab495fc473076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Fri, 17 Jun 2022 20:16:34 +0200 Subject: [PATCH] Wayland: Cleanup (cherry picked from commit 98c9961f3265c1a926e16ff454274e75eda377f2) --- src/wl_monitor.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/wl_monitor.c b/src/wl_monitor.c index 3c2ebc55..f11fb874 100644 --- a/src/wl_monitor.c +++ b/src/wl_monitor.c @@ -121,9 +121,6 @@ static const struct wl_output_listener outputListener = void _glfwAddOutputWayland(uint32_t name, uint32_t version) { - _GLFWmonitor* monitor; - struct wl_output* output; - if (version < 2) { _glfwInputError(GLFW_PLATFORM_ERROR, @@ -131,19 +128,15 @@ void _glfwAddOutputWayland(uint32_t name, uint32_t version) return; } - // The actual name of this output will be set in the geometry handler. - monitor = _glfwAllocMonitor("", 0, 0); - - output = wl_registry_bind(_glfw.wl.registry, - name, - &wl_output_interface, - 2); + struct wl_output* output = wl_registry_bind(_glfw.wl.registry, + name, + &wl_output_interface, + 2); if (!output) - { - _glfwFreeMonitor(monitor); return; - } + // The actual name of this output will be set in the geometry handler + _GLFWmonitor* monitor = _glfwAllocMonitor("", 0, 0); monitor->wl.scale = 1; monitor->wl.output = output; monitor->wl.name = name;