summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-08-12 08:48:00 +0200
committerGitHub <noreply@github.com>2019-08-12 08:48:00 +0200
commit7464e61fab3d7b11c476f2917e46531f0027cc35 (patch)
tree9a3c3882927ed6000e3eacc152b79d402806dbb6 /platform/x11
parent6f7e898b9f732fe9f91c2a1798b0503247e23678 (diff)
parentdeb73001ab3874afa40dd12a4260e2d4c9fba641 (diff)
Merge pull request #31277 from drougge/fvwmfix
Work around Editor hangs and makes Xorg take up 100% cpu [fvwm]
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/os_x11.cpp9
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);
}
}