Index: base/message_pump_aurax11.cc |
diff --git a/base/message_pump_aurax11.cc b/base/message_pump_aurax11.cc |
index 10f95cb3767d9251659438c177257c0b429966c7..7f47fa675fe6e655c403f6415704aa0d7ccf67a4 100644 |
--- a/base/message_pump_aurax11.cc |
+++ b/base/message_pump_aurax11.cc |
@@ -139,6 +139,12 @@ void MessagePumpAuraX11::SetDefaultDispatcher( |
g_default_dispatcher = dispatcher; |
} |
+// static |
+MessagePumpAuraX11* MessagePumpAuraX11::Current() { |
+ MessageLoopForUI* loop = MessageLoopForUI::current(); |
+ return static_cast<MessagePumpAuraX11*>(loop->pump_ui()); |
+} |
+ |
bool MessagePumpAuraX11::DispatchXEvents() { |
Display* display = GetDefaultXDisplay(); |
DCHECK(display); |
@@ -156,6 +162,23 @@ bool MessagePumpAuraX11::DispatchXEvents() { |
return TRUE; |
} |
+void MessagePumpAuraX11::BlockUntilWindowMapped(unsigned long window) { |
+ XEvent event; |
+ |
+ Display* display = GetDefaultXDisplay(); |
+ DCHECK(display); |
+ |
+ MessagePumpDispatcher* dispatcher = |
+ GetDispatcher() ? GetDispatcher() : g_default_dispatcher; |
+ |
+ 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); |
+ ProcessXEvent(dispatcher, &event); |
+ } while (event.type != MapNotify); |
+} |
+ |
MessagePumpAuraX11::~MessagePumpAuraX11() { |
g_source_destroy(x_source_); |
g_source_unref(x_source_); |