Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Linux fullscreen mode doesn't preserve maximized state #75838

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion platform/linuxbsd/x11/display_server_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2249,7 +2249,7 @@ void DisplayServerX11::window_set_mode(WindowMode p_mode, WindowID p_window) {

switch (old_mode) {
case WINDOW_MODE_WINDOWED: {
//do nothing
was_maximized = false;
} break;
case WINDOW_MODE_MINIMIZED: {
_set_wm_minimized(p_window, false);
Expand All @@ -2267,12 +2267,17 @@ void DisplayServerX11::window_set_mode(WindowMode p_mode, WindowID p_window) {

window_set_position(wd.last_position_before_fs, p_window);

if (was_maximized && p_mode == WINDOW_MODE_WINDOWED) {
p_mode = WINDOW_MODE_MAXIMIZED;
}

if (on_top) {
_set_wm_maximized(p_window, false);
}

} break;
case WINDOW_MODE_MAXIMIZED: {
was_maximized = true;
_set_wm_maximized(p_window, false);
} break;
}
Expand Down
2 changes: 2 additions & 0 deletions platform/linuxbsd/x11/display_server_x11.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ class DisplayServerX11 : public DisplayServer {
Point2i im_selection;
String im_text;

bool was_maximized = false;

#ifdef XKB_ENABLED
bool xkb_loaded = false;
xkb_context *xkb_ctx = nullptr;
Expand Down