aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/views/unix/SkOSWindow_Unix.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/views/unix/SkOSWindow_Unix.cpp b/src/views/unix/SkOSWindow_Unix.cpp
index 374dbccc34..078a9f9d56 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);