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; |
} |