Prevent auto-iconify from firing on window creation

This commit is contained in:
Emmanuel Gil Peyrot 2018-01-19 00:24:57 +01:00 committed by linkmauve
parent 94c7aa0d67
commit eb7c9994bf
2 changed files with 6 additions and 1 deletions

View File

@ -177,6 +177,9 @@ typedef struct _GLFWwindowWayland
struct zwp_idle_inhibitor_v1* idleInhibitor; struct zwp_idle_inhibitor_v1* idleInhibitor;
// This is a hack to prevent auto-iconification on creation.
GLFWbool justCreated;
} _GLFWwindowWayland; } _GLFWwindowWayland;
// Wayland-specific global data // Wayland-specific global data

View File

@ -338,9 +338,10 @@ static void xdgToplevelHandleConfigure(void* data,
_glfwInputWindowDamage(window); _glfwInputWindowDamage(window);
} }
if (!activated && window->autoIconify) if (!window->wl.justCreated && !activated && window->autoIconify)
_glfwPlatformIconifyWindow(window); _glfwPlatformIconifyWindow(window);
_glfwInputWindowFocus(window, activated); _glfwInputWindowFocus(window, activated);
window->wl.justCreated = GLFW_FALSE;
} }
static void xdgToplevelHandleClose(void* data, static void xdgToplevelHandleClose(void* data,
@ -561,6 +562,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
const _GLFWctxconfig* ctxconfig, const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig) const _GLFWfbconfig* fbconfig)
{ {
window->wl.justCreated = GLFW_TRUE;
window->wl.transparent = fbconfig->transparent; window->wl.transparent = fbconfig->transparent;
if (!createSurface(window, wndconfig)) if (!createSurface(window, wndconfig))