X11: Process entire event queue at startup.

Should fix #14336
This commit is contained in:
Andreas Haas 2017-12-09 23:21:34 +01:00
parent fae98c0b6a
commit 94a573bb39
No known key found for this signature in database
GPG key ID: B5FFAE1B65FBD2E1
2 changed files with 5 additions and 7 deletions

View file

@ -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) {

View file

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