Index: src/views/unix/SkOSWindow_Unix.cpp |
diff --git a/src/views/unix/SkOSWindow_Unix.cpp b/src/views/unix/SkOSWindow_Unix.cpp |
index 374dbccc346608501a7463c1527a1cc7eb8b2609..078a9f9d56c6a15e79c78a2acd2e7f4d1cec8e6e 100644 |
--- a/src/views/unix/SkOSWindow_Unix.cpp |
+++ b/src/views/unix/SkOSWindow_Unix.cpp |
@@ -172,6 +172,13 @@ static unsigned getModi(const XEvent& evt) { |
static SkMSec gTimerDelay; |
static bool MyXNextEventWithDelay(Display* dsp, XEvent* evt) { |
+ // Check for pending events before entering the select loop. There might |
+ // be events in the in-memory queue but not processed yet. |
+ if (XPending(dsp)) { |
+ XNextEvent(dsp, evt); |
+ return true; |
+ } |
+ |
SkMSec ms = gTimerDelay; |
if (ms > 0) { |
int x11_fd = ConnectionNumber(dsp); |