Created
November 8, 2013 21:24
-
-
Save tiagovignatti/7377907 to your computer and use it in GitHub Desktop.
[PATCH] WIP: Multi root window dispatcher support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 96f1a1003f89d33b8335f9b35c601d074b931d75 Mon Sep 17 00:00:00 2001 | |
From: Tiago Vignatti <[email protected]> | |
Date: Fri, 8 Nov 2013 18:27:48 -0200 | |
Subject: [PATCH] WIP: Multi root window dispatcher support | |
--- | |
base/message_loop/message_pump_ozone.cc | 16 ++++++++-------- | |
1 file changed, 8 insertions(+), 8 deletions(-) | |
diff --git a/base/message_loop/message_pump_ozone.cc b/base/message_loop/message_pump_ozone.cc | |
index f7bff6d..c4725bd 100644 | |
--- a/base/message_loop/message_pump_ozone.cc | |
+++ b/base/message_loop/message_pump_ozone.cc | |
@@ -32,22 +32,22 @@ MessagePumpOzone* MessagePumpOzone::Current() { | |
void MessagePumpOzone::AddDispatcherForRootWindow( | |
MessagePumpDispatcher* dispatcher) { | |
- // Only one root window is supported. | |
- DCHECK(dispatcher_.size() == 0); | |
- dispatcher_.insert(dispatcher_.begin(),dispatcher); | |
+ dispatcher_.push_back(dispatcher); | |
} | |
void MessagePumpOzone::RemoveDispatcherForRootWindow( | |
MessagePumpDispatcher* dispatcher) { | |
- DCHECK(dispatcher_.size() == 1); | |
- dispatcher_.pop_back(); | |
+ DCHECK(dispatcher_.size() >= 1); | |
+ dispatcher_.erase(std::remove( | |
+ dispatcher_.begin(), dispatcher_.end(), dispatcher), dispatcher_.end()); | |
} | |
bool MessagePumpOzone::Dispatch(const NativeEvent& dev) { | |
- if (dispatcher_.size() > 0) | |
- return dispatcher_[0]->Dispatch(dev); | |
- else | |
+ if (dispatcher_.size() == 0) | |
return true; | |
+ | |
+ //TODO(vignatti): how to get the activated root window? | |
+ return dispatcher_[0]->Dispatch(dev); | |
} | |
// This code assumes that the caller tracks the lifetime of the |dispatcher|. | |
-- | |
1.7.9.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment