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

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

Issue 2057333002: X11: Wait for UnmapNotify before trying to remap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 c9e5e15d5967b1f5afeb97802f73e308c216c841..3af94e3f76ed6e00050e49a34511e122c6e461fc 100644
--- a/ui/events/platform/x11/x11_event_source.cc
+++ b/ui/events/platform/x11/x11_event_source.cc
@@ -141,13 +141,11 @@ void X11EventSource::DispatchXEvents() {
}
void X11EventSource::BlockUntilWindowMapped(XID window) {
- XEvent event;
- do {
- // Block until there's a message of |event_mask| type on |w|. Then remove
- // it from the queue and stuff it in |event|.
- XWindowEvent(display_, window, StructureNotifyMask, &event);
- ExtractCookieDataDispatchEvent(&event);
- } while (event.type != MapNotify);
+ BlockOnWindowStructureEvent(window, MapNotify);
+}
+
+void X11EventSource::BlockUntilWindowUnmapped(XID window) {
+ BlockOnWindowStructureEvent(window, UnmapNotify);
}
Time X11EventSource::UpdateLastSeenServerTime() {
@@ -225,6 +223,16 @@ void X11EventSource::PostDispatchEvent(XEvent* xevent) {
}
}
+void X11EventSource::BlockOnWindowStructureEvent(XID window, int type) {
+ XEvent event;
+ do {
+ // Block until there's a StructureNotify event of |type| on |window|. Then
+ // remove it from the queue and stuff it in |event|.
+ XWindowEvent(display_, window, StructureNotifyMask, &event);
+ ExtractCookieDataDispatchEvent(&event);
+ } while (event.type != type);
+}
+
void X11EventSource::StopCurrentEventStream() {
continue_stream_ = false;
}
« no previous file with comments | « ui/events/platform/x11/x11_event_source.h ('k') | ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698