GLFW: Move management of shared state to shared code
From upstream: 6d2003d07a.
This commit is contained in:
parent
d7cd6edaa5
commit
805921d6a3
@ -1856,7 +1856,6 @@ void _glfwPlatformSetWindowFloating(_GLFWwindow* window, bool enabled)
|
|||||||
|
|
||||||
void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled)
|
void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled)
|
||||||
{
|
{
|
||||||
window->mousePassthrough = enabled;
|
|
||||||
[window->ns.object setIgnoresMouseEvents:enabled];
|
[window->ns.object setIgnoresMouseEvents:enabled];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
7
glfw/window.c
vendored
7
glfw/window.c
vendored
@ -246,6 +246,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
|||||||
window->autoIconify = wndconfig.autoIconify;
|
window->autoIconify = wndconfig.autoIconify;
|
||||||
window->floating = wndconfig.floating;
|
window->floating = wndconfig.floating;
|
||||||
window->focusOnShow = wndconfig.focusOnShow;
|
window->focusOnShow = wndconfig.focusOnShow;
|
||||||
|
window->mousePassthrough = wndconfig.mousePassthrough;
|
||||||
window->cursorMode = GLFW_CURSOR_NORMAL;
|
window->cursorMode = GLFW_CURSOR_NORMAL;
|
||||||
|
|
||||||
window->minwidth = GLFW_DONT_CARE;
|
window->minwidth = GLFW_DONT_CARE;
|
||||||
@ -993,7 +994,13 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value)
|
|||||||
else if (attrib == GLFW_FOCUS_ON_SHOW)
|
else if (attrib == GLFW_FOCUS_ON_SHOW)
|
||||||
window->focusOnShow = value;
|
window->focusOnShow = value;
|
||||||
else if (attrib == GLFW_MOUSE_PASSTHROUGH)
|
else if (attrib == GLFW_MOUSE_PASSTHROUGH)
|
||||||
|
{
|
||||||
|
if (window->mousePassthrough == value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
window->mousePassthrough = value;
|
||||||
_glfwPlatformSetWindowMousePassthrough(window, value);
|
_glfwPlatformSetWindowMousePassthrough(window, value);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
_glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib);
|
_glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib);
|
||||||
}
|
}
|
||||||
|
|||||||
4
glfw/wl_window.c
vendored
4
glfw/wl_window.c
vendored
@ -1271,9 +1271,6 @@ void _glfwPlatformSetWindowFloating(_GLFWwindow* window UNUSED, bool enabled UNU
|
|||||||
|
|
||||||
void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled)
|
void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled)
|
||||||
{
|
{
|
||||||
if (enabled == window->mousePassthrough)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (enabled)
|
if (enabled)
|
||||||
{
|
{
|
||||||
struct wl_region* region = wl_compositor_create_region(_glfw.wl.compositor);
|
struct wl_region* region = wl_compositor_create_region(_glfw.wl.compositor);
|
||||||
@ -1283,7 +1280,6 @@ void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled)
|
|||||||
else
|
else
|
||||||
wl_surface_set_input_region(window->wl.surface, 0);
|
wl_surface_set_input_region(window->wl.surface, 0);
|
||||||
wl_surface_commit(window->wl.surface);
|
wl_surface_commit(window->wl.surface);
|
||||||
window->mousePassthrough = enabled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float _glfwPlatformGetWindowOpacity(_GLFWwindow* window UNUSED)
|
float _glfwPlatformGetWindowOpacity(_GLFWwindow* window UNUSED)
|
||||||
|
|||||||
5
glfw/x11_window.c
vendored
5
glfw/x11_window.c
vendored
@ -2591,9 +2591,6 @@ void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled)
|
|||||||
if (!_glfw.x11.xshape.available)
|
if (!_glfw.x11.xshape.available)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (enabled == window->mousePassthrough)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (enabled)
|
if (enabled)
|
||||||
{
|
{
|
||||||
Region region = XCreateRegion();
|
Region region = XCreateRegion();
|
||||||
@ -2606,8 +2603,6 @@ void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled)
|
|||||||
XShapeCombineMask(_glfw.x11.display, window->x11.handle,
|
XShapeCombineMask(_glfw.x11.display, window->x11.handle,
|
||||||
ShapeInput, 0, 0, None, ShapeSet);
|
ShapeInput, 0, 0, None, ShapeSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
window->mousePassthrough = enabled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float _glfwPlatformGetWindowOpacity(_GLFWwindow* window)
|
float _glfwPlatformGetWindowOpacity(_GLFWwindow* window)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user