8000 Explicitly unmap iconified windows before restoring them. by rbernon · Pull Request #2689 · glfw/glfw · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Explicitly unmap iconified windows before restoring them. #2689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/x11_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -2339,6 +2339,9 @@ void _glfwRestoreWindowX11(_GLFWwindow* window)

if (_glfwWindowIconifiedX11(window))
{
// Some window managers do not unmap iconified windows, and XMapWindow is
// then no-op. Explicitly unmap the window to make sure it gets restored.
XUnmapWindow(_glfw.x11.display, window->x11.handle);
XMapWindow(_glfw.x11.display, window->x11.handle);
waitForVisibilityNotify(window);
}
Expand Down
8 changes: 7 additions & 1 deletion tests/iconify.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ static void error_callback(int error, const char* description)

static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
static GLFWwindow *iconified;

printf("%0.2f Key %s\n",
glfwGetTime(),
action == GLFW_PRESS ? "pressed" : "released");
Expand All @@ -67,12 +69,15 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
{
case GLFW_KEY_I:
glfwIconifyWindow(window);
iconified = window;
break;
case GLFW_KEY_M:
glfwMaximizeWindow(window);
break;
case GLFW_KEY_R:
if (iconified) window = iconified;
glfwRestoreWindow(window);
iconified = NULL;
break;
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GLFW_TRUE);
Expand Down Expand Up @@ -253,9 +258,10 @@ int main(int argc, char** argv)
if (fullscreen)
monitor = glfwGetPrimaryMonitor();

window_count = 1;
window_count = 2;
windows = calloc(window_count, sizeof(GLFWwindow*));
windows[0] = create_window(monitor);
windows[1] = create_window(monitor);
}

for (i = 0; i < window_count; i++)
Expand Down
0