Merge pull request #31277 from drougge/fvwmfix

Work around Editor hangs and makes Xorg take up 100% cpu [fvwm]
This commit is contained in:
Rémi Verschelde 2019-08-12 08:48:00 +02:00 committed by GitHub
commit 7464e61fab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}
}