diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-17 22:43:46 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-17 22:43:46 +0000 |
commit | e46617f1a3089f5e9482b5228e5af56cd87f1bd0 (patch) | |
tree | ef43f67e22002866cea6f5a997653a5379ae9809 /base/message_pump_aurax11.cc | |
parent | 70d7ca92922439fb62b6c7e5c71ed6ea04ff6d32 (diff) | |
download | chromium_src-e46617f1a3089f5e9482b5228e5af56cd87f1bd0.zip chromium_src-e46617f1a3089f5e9482b5228e5af56cd87f1bd0.tar.gz chromium_src-e46617f1a3089f5e9482b5228e5af56cd87f1bd0.tar.bz2 |
Desktop Aura: Allow tab drags out of window.
You can now drag tabs in and out of windows in linux_aura builds. This patch has a lot of moving parts and caveats though.
Moving parts in the patch:
- Added system location to aura::Events.
- Forwarding move events from RootWindowHostLinux to the TabDragController through an observer.
- MessagePumpAuraX11 now can block waiting for a window to be mapped. If we don't do this, we can't perform a grab on the new window.
- The drag offset is threaded from TabDragController through the WindowMoveController interface. (There's no other non-racey way of getting this data locally from X.)
- RootWindowHostLinux now has working Show()/Hide().
TODOs:
- After releasing a new window, the window looks focused, but isn't. You have to click on it for it to receive input focus.
BUG=133059
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10828133
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152180 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_pump_aurax11.cc')
-rw-r--r-- | base/message_pump_aurax11.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/base/message_pump_aurax11.cc b/base/message_pump_aurax11.cc index 10f95cb..7f47fa6 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_); |