diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 60e427ebe..9fe453da6 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -1856,7 +1856,6 @@ void _glfwPlatformSetWindowFloating(_GLFWwindow* window, bool enabled) void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled) { - window->mousePassthrough = enabled; [window->ns.object setIgnoresMouseEvents:enabled]; } diff --git a/glfw/window.c b/glfw/window.c index b7453f09a..712d65844 100644 --- a/glfw/window.c +++ b/glfw/window.c @@ -240,13 +240,14 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, window->videoMode.blueBits = fbconfig.blueBits; window->videoMode.refreshRate = _glfw.hints.refreshRate; - window->monitor = (_GLFWmonitor*) monitor; - window->resizable = wndconfig.resizable; - window->decorated = wndconfig.decorated; - window->autoIconify = wndconfig.autoIconify; - window->floating = wndconfig.floating; - window->focusOnShow = wndconfig.focusOnShow; - window->cursorMode = GLFW_CURSOR_NORMAL; + window->monitor = (_GLFWmonitor*) monitor; + window->resizable = wndconfig.resizable; + window->decorated = wndconfig.decorated; + window->autoIconify = wndconfig.autoIconify; + window->floating = wndconfig.floating; + window->focusOnShow = wndconfig.focusOnShow; + window->mousePassthrough = wndconfig.mousePassthrough; + window->cursorMode = GLFW_CURSOR_NORMAL; window->minwidth = GLFW_DONT_CARE; window->minheight = GLFW_DONT_CARE; @@ -993,7 +994,13 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value) else if (attrib == GLFW_FOCUS_ON_SHOW) window->focusOnShow = value; else if (attrib == GLFW_MOUSE_PASSTHROUGH) + { + if (window->mousePassthrough == value) + return; + + window->mousePassthrough = value; _glfwPlatformSetWindowMousePassthrough(window, value); + } else _glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib); } diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 6d35f5de9..da3717820 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -1271,9 +1271,6 @@ void _glfwPlatformSetWindowFloating(_GLFWwindow* window UNUSED, bool enabled UNU void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled) { - if (enabled == window->mousePassthrough) - return; - if (enabled) { struct wl_region* region = wl_compositor_create_region(_glfw.wl.compositor); @@ -1283,7 +1280,6 @@ void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled) else wl_surface_set_input_region(window->wl.surface, 0); wl_surface_commit(window->wl.surface); - window->mousePassthrough = enabled; } float _glfwPlatformGetWindowOpacity(_GLFWwindow* window UNUSED) diff --git a/glfw/x11_window.c b/glfw/x11_window.c index c51163184..15d2f1c6f 100644 --- a/glfw/x11_window.c +++ b/glfw/x11_window.c @@ -2591,9 +2591,6 @@ void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled) if (!_glfw.x11.xshape.available) return; - if (enabled == window->mousePassthrough) - return; - if (enabled) { Region region = XCreateRegion(); @@ -2606,8 +2603,6 @@ void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled) XShapeCombineMask(_glfw.x11.display, window->x11.handle, ShapeInput, 0, 0, None, ShapeSet); } - - window->mousePassthrough = enabled; } float _glfwPlatformGetWindowOpacity(_GLFWwindow* window)