Wayland: Fix auto-iconify on kwin_wayland

Upstream: 45bd991ea9
This commit is contained in:
Kovid Goyal
2019-02-17 10:35:39 +05:30
parent 1c468b2931
commit 423f8e59cc
2 changed files with 11 additions and 5 deletions

2
glfw/wl_platform.h vendored
View File

@@ -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;

14
glfw/wl_window.c vendored
View File

@@ -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));