diff options
author | Carl Drougge <bearded@longhaired.org> | 2019-08-10 21:09:21 +0200 |
---|---|---|
committer | Carl Drougge <bearded@longhaired.org> | 2019-08-10 21:29:45 +0200 |
commit | deb73001ab3874afa40dd12a4260e2d4c9fba641 (patch) | |
tree | 8ea46748d1998caa5f70991cce1a0e3d99f648a0 /platform/x11 | |
parent | 3418f76a9eab9f496e5b26310bd3bc1125b8119b (diff) |
OS_X11::set_window_maximized gives up after 0.5s
Spinning forever is clearly worse, especially since this happens on at
least FVWM even though the window actually is maximized.
Diffstat (limited to 'platform/x11')
-rw-r--r-- | platform/x11/os_x11.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 0d1e702d04..ca72393e43 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1518,9 +1518,12 @@ void OS_X11::set_window_maximized(bool p_enabled) { XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); - if (is_window_maximize_allowed()) { - while (p_enabled && !is_window_maximized()) { - // Wait for effective resizing (so the GLX context is too). + if (p_enabled && is_window_maximize_allowed()) { + // Wait for effective resizing (so the GLX context is too). + // Give up after 0.5s, it's not going to happen on this WM. + // https://github.com/godotengine/godot/issues/19978 + for (int attempt = 0; !is_window_maximized() && attempt < 50; attempt++) { + usleep(10000); } } |