Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(644)

Unified Diff: ui/events/platform/x11/x11_event_source.cc

Issue 274383002: events: Remove ability to terminate a nested message-loop from the event-source. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/events/platform/x11/x11_event_source.cc
diff --git a/ui/events/platform/x11/x11_event_source.cc b/ui/events/platform/x11/x11_event_source.cc
index e074bc8e79cb41618f0049cee3c898bfca1b3119..25e74098fac3825bc0e886e6b6967875ca0b55e8 100644
--- a/ui/events/platform/x11/x11_event_source.cc
+++ b/ui/events/platform/x11/x11_event_source.cc
@@ -80,7 +80,8 @@ bool InitializeXkb(XDisplay* display) {
} // namespace
X11EventSource::X11EventSource(XDisplay* display)
- : display_(display) {
+ : display_(display),
+ continue_stream_(true) {
CHECK(display_);
InitializeXInput2(display_);
InitializeXkb(display_);
@@ -102,12 +103,11 @@ void X11EventSource::DispatchXEvents() {
// Handle all pending events.
// It may be useful to eventually align this event dispatch with vsync, but
// not yet.
- while (XPending(display_)) {
+ continue_stream_ = true;
+ while (XPending(display_) && continue_stream_) {
XEvent xevent;
XNextEvent(display_, &xevent);
- uint32_t action = DispatchEvent(&xevent);
- if (action & POST_DISPATCH_QUIT_LOOP)
- break;
+ DispatchEvent(&xevent);
}
}
@@ -142,4 +142,8 @@ uint32_t X11EventSource::DispatchEvent(XEvent* xevent) {
return action;
}
+void X11EventSource::StopCurrentEventStream() {
+ continue_stream_ = false;
+}
+
} // namespace ui
« ash/accelerators/accelerator_dispatcher_linux.cc ('K') | « ui/events/platform/x11/x11_event_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698