From e4d052e284c04c9fd41d42de40151451e8756a6b Mon Sep 17 00:00:00 2001 From: Christopher Foo Date: Mon, 8 May 2023 20:23:45 -0400 Subject: [PATCH] Ensure WindowData minimized/maximized are mutually exclusive The window manager can break the assumption that fullscreen/maximized/minimized values are mutually exclusive. --- platform/linuxbsd/x11/display_server_x11.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index ac4fbe2068b..86423f798fd 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -3497,8 +3497,8 @@ void DisplayServerX11::_window_changed(XEvent *event) { // Query display server about a possible new window state. wd.fullscreen = _window_fullscreen_check(window_id); - wd.minimized = _window_minimize_check(window_id); - wd.maximized = _window_maximize_check(window_id, "_NET_WM_STATE"); + wd.maximized = _window_maximize_check(window_id, "_NET_WM_STATE") && !wd.fullscreen; + wd.minimized = _window_minimize_check(window_id) && !wd.fullscreen && !wd.maximized; // Readjusting the window position if the window is being reparented by the window manager for decoration Window root, parent, *children;