mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 13:32:01 +00:00
Wayland: Fix auto-iconify on kwin_wayland
We now keep track of the fullscreen and activated state and only iconify if we were previously fullscreen and now we are either not fullscreen or not activated anymore. This is the proper way to do it, compared to the previous hack where we didn’t iconify only if it was the first configure event received.
This commit is contained in:
parent
edf0a07174
commit
45bd991ea9
@ -208,8 +208,7 @@ 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 wasFullscreen;
|
||||||
GLFWbool justCreated;
|
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
GLFWbool serverSide;
|
GLFWbool serverSide;
|
||||||
|
@ -641,10 +641,17 @@ static void xdgToplevelHandleConfigure(void* data,
|
|||||||
_glfwInputWindowDamage(window);
|
_glfwInputWindowDamage(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!window->wl.justCreated && !activated && window->monitor && window->autoIconify)
|
if (window->wl.wasFullscreen && window->autoIconify)
|
||||||
|
{
|
||||||
|
if (!activated || !fullscreen)
|
||||||
|
{
|
||||||
_glfwPlatformIconifyWindow(window);
|
_glfwPlatformIconifyWindow(window);
|
||||||
|
window->wl.wasFullscreen = GLFW_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fullscreen && activated)
|
||||||
|
window->wl.wasFullscreen = GLFW_TRUE;
|
||||||
_glfwInputWindowFocus(window, activated);
|
_glfwInputWindowFocus(window, activated);
|
||||||
window->wl.justCreated = GLFW_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xdgToplevelHandleClose(void* data,
|
static void xdgToplevelHandleClose(void* data,
|
||||||
@ -913,7 +920,6 @@ 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))
|
||||||
|
Loading…
Reference in New Issue
Block a user