From 96e0f4939565602fd418008f8dde2f108665d8e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 6 Jan 2026 20:12:48 +0100 Subject: [PATCH] X11: Place argument assertion after platform check This lets automated testing check that GLFW_NOT_INITIALIZED is emitted for every public function. --- src/x11_window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x11_window.c b/src/x11_window.c index 9a84e5c7..47b9ad1e 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -3344,8 +3344,6 @@ GLFWAPI Window glfwGetX11Window(GLFWwindow* handle) GLFWAPI void glfwSetX11SelectionString(const char* string) { - assert(string != NULL); - _GLFW_REQUIRE_INIT(); if (_glfw.platform.platformID != GLFW_PLATFORM_X11) @@ -3354,6 +3352,8 @@ GLFWAPI void glfwSetX11SelectionString(const char* string) return; } + assert(string != NULL); + _glfw_free(_glfw.x11.primarySelectionString); _glfw.x11.primarySelectionString = _glfw_strdup(string);