Explorar o código

X11: Process entire event queue at startup.

Should fix #14336
Andreas Haas %!s(int64=7) %!d(string=hai) anos
pai
achega
94a573bb39
Modificáronse 2 ficheiros con 5 adicións e 7 borrados
  1. 5 6
      platform/x11/os_x11.cpp
  2. 0 1
      platform/x11/os_x11.h

+ 5 - 6
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) {
 

+ 0 - 1
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();