mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 04:54:35 +00:00
handle VisibilityNotify on x11 so that a window that is mapped but covered by another window is considered as not visible
This commit is contained in:
parent
2c7f3ce91b
commit
58de77fc49
@ -383,6 +383,7 @@ struct _GLFWwindow
|
|||||||
GLFWbool focusOnShow;
|
GLFWbool focusOnShow;
|
||||||
GLFWbool mousePassthrough;
|
GLFWbool mousePassthrough;
|
||||||
GLFWbool shouldClose;
|
GLFWbool shouldClose;
|
||||||
|
GLFWbool visible;
|
||||||
void* userPointer;
|
void* userPointer;
|
||||||
GLFWvidmode videoMode;
|
GLFWvidmode videoMode;
|
||||||
_GLFWmonitor* monitor;
|
_GLFWmonitor* monitor;
|
||||||
|
@ -119,7 +119,7 @@ static GLFWbool waitForVisibilityNotify(_GLFWwindow* window)
|
|||||||
if (!waitForEvent(&timeout))
|
if (!waitForEvent(&timeout))
|
||||||
return GLFW_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
window->visible = GLFW_TRUE;
|
||||||
return GLFW_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1838,6 +1838,12 @@ static void processEvent(XEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case VisibilityNotify :
|
||||||
|
{
|
||||||
|
if (event->xvisibility.state == VisibilityFullyObscured) window->visible = GLFW_FALSE;
|
||||||
|
else window->visible = GLFW_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
case DestroyNotify:
|
case DestroyNotify:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2529,7 +2535,7 @@ int _glfwPlatformWindowVisible(_GLFWwindow* window)
|
|||||||
{
|
{
|
||||||
XWindowAttributes wa;
|
XWindowAttributes wa;
|
||||||
XGetWindowAttributes(_glfw.x11.display, window->x11.handle, &wa);
|
XGetWindowAttributes(_glfw.x11.display, window->x11.handle, &wa);
|
||||||
return wa.map_state == IsViewable;
|
return wa.map_state == IsViewable && window->visible == GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _glfwPlatformWindowMaximized(_GLFWwindow* window)
|
int _glfwPlatformWindowMaximized(_GLFWwindow* window)
|
||||||
|
Loading…
Reference in New Issue
Block a user