diff options
author | Andreas Haas <liu.gam3@gmail.com> | 2017-12-09 23:21:34 +0100 |
---|---|---|
committer | Andreas Haas <liu.gam3@gmail.com> | 2017-12-09 23:24:25 +0100 |
commit | 94a573bb3987957f9d63d94a298da0c2e296c878 (patch) | |
tree | 575ba1e08b0c98d4aa416daf7eceed29c5cec04c /platform/x11 | |
parent | fae98c0b6a248c48598bd44f75103252e22cc2b4 (diff) |
X11: Process entire event queue at startup.
Should fix #14336
Diffstat (limited to 'platform/x11')
-rw-r--r-- | platform/x11/os_x11.cpp | 11 | ||||
-rw-r--r-- | platform/x11/os_x11.h | 1 |
2 files changed, 5 insertions, 7 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 263ff012d4..49a2f14bef 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -512,15 +512,14 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au power_manager = memnew(PowerX11); XEvent xevent; - while (XCheckIfEvent(x11_display, &xevent, _check_window_events, NULL)) { - _window_changed(&xevent); + while (XPending(x11_display) > 0) { + XNextEvent(x11_display, &xevent); + if (xevent.type == ConfigureNotify) { + _window_changed(&xevent); + } } } -int OS_X11::_check_window_events(Display *display, XEvent *event, char *arg) { - if (event->type == ConfigureNotify) return 1; - return 0; -} void OS_X11::xim_destroy_callback(::XIM im, ::XPointer client_data, ::XPointer call_data) { diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 84dff2e089..244c69ee2b 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -199,7 +199,6 @@ protected: virtual void set_main_loop(MainLoop *p_main_loop); void _window_changed(XEvent *xevent); - static int _check_window_events(Display *display, XEvent *xevent, char *arg); public: virtual String get_name(); |