diff --git a/glfw/wl_platform.h b/glfw/wl_platform.h index d2a42ee50..c46e957bc 100644 --- a/glfw/wl_platform.h +++ b/glfw/wl_platform.h @@ -169,7 +169,7 @@ typedef struct _GLFWwindowWayland struct zwp_idle_inhibitor_v1* idleInhibitor; // This is a hack to prevent auto-iconification on creation. - GLFWbool justCreated; + GLFWbool wasFullScreen; struct { GLFWbool serverSide; diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 2aa60aa1d..8ff6bad04 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -633,10 +633,17 @@ static void xdgToplevelHandleConfigure(void* data, _glfwInputWindowDamage(window); } - if (!window->wl.justCreated && !activated && window->monitor && window->autoIconify) - _glfwPlatformIconifyWindow(window); + if (window->wl.wasFullScreen && window->autoIconify) + { + if (!activated || !fullscreen) + { + _glfwPlatformIconifyWindow(window); + window->wl.wasFullScreen = GLFW_FALSE; + } + } + if (fullscreen && activated) + window->wl.wasFullScreen = GLFW_TRUE; _glfwInputWindowFocus(window, activated); - window->wl.justCreated = GLFW_FALSE; } static void xdgToplevelHandleClose(void* data, @@ -877,7 +884,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig) { - window->wl.justCreated = GLFW_TRUE; window->wl.transparent = fbconfig->transparent; strncpy(window->wl.appId, wndconfig->wl.appId, sizeof(window->wl.appId));