summaryrefslogtreecommitdiff
path: root/platform/x11/os_x11.cpp
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2020-02-03 18:14:41 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2020-02-03 18:16:20 +0300
commit90f00c0813b8335605c81b5d5063922efe5519e3 (patch)
treeb104c958bab896b72e73d33146b77ac1ed7fa5ec /platform/x11/os_x11.cpp
parente5cb4f03c554a48c6d0b400ad53d4fad933d4dc7 (diff)
Restores correct window position after fullscreen toggling off on Linux
Diffstat (limited to 'platform/x11/os_x11.cpp')
-rw-r--r--platform/x11/os_x11.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 8195006121..e40aa867f8 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1433,7 +1433,11 @@ void OS_X11::set_window_fullscreen(bool p_enabled) {
// Restore
set_window_maximized(false);
}
-
+ if (!p_enabled) {
+ set_window_position(last_position_before_fs);
+ } else {
+ last_position_before_fs = get_window_position();
+ }
current_videomode.fullscreen = p_enabled;
}
@@ -3502,4 +3506,5 @@ OS_X11::OS_X11() {
window_focused = true;
xim_style = 0L;
mouse_mode = MOUSE_MODE_VISIBLE;
+ last_position_before_fs = Vector2();
}