Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h |
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h |
index c16ef57c964e32a57cc299d0beafc3725734754f..0eba6c4bc54339ab6b2bcd2f93d7f127d07aa64e 100644 |
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h |
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h |
@@ -37,7 +37,7 @@ class DesktopDragDropClientAuraX11; |
class DesktopDispatcherClient; |
class DesktopWindowTreeHostObserverX11; |
class X11DesktopWindowMoveClient; |
-class X11ScopedCapture; |
+class X11CaptureWindow; |
class X11WindowEventFilter; |
class VIEWS_EXPORT DesktopWindowTreeHostX11 |
@@ -167,6 +167,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 |
virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; |
private: |
+ FRIEND_TEST_ALL_PREFIXES(DesktopWindowTreeHostX11InteractiveUITest, |
+ SynchronousCapture); |
+ |
// Initializes our X11 surface to draw on. This method performs all |
// initialization related to talking to the X11 server. |
void InitX11Window(const Widget::InitParams& params); |
@@ -197,9 +200,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 |
// Sets whether the window's borders are provided by the window manager. |
void SetUseNativeFrame(bool use_native_frame); |
- // Called when another DRWHL takes capture, or when capture is released |
- // entirely. |
- void OnCaptureReleased(); |
+ // Releases |capture_window_| so that it can be used by another |
+ // DesktopWindowTreeHostX11. |
+ scoped_ptr<X11CaptureWindow> ReleaseCaptureWindow(); |
// Dispatches a mouse event, taking mouse capture into account. If a |
// different host has capture, we translate the event to its coordinate space |
@@ -318,18 +321,15 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 |
// The size of the window manager provided borders (if any). |
gfx::Insets native_window_frame_borders_; |
- // The current root window host that has capture. While X11 has something |
- // like Windows SetCapture()/ReleaseCapture(), it is entirely implicit and |
- // there are no notifications when this changes. We need to track this so we |
- // can notify widgets when they have lost capture, which controls a bunch of |
- // things in views like hiding menus. |
+ // The current DesktopWindowTreeHostX11 which has capture. Set synchronously |
+ // when capture is requested via SetCapture(). |
static DesktopWindowTreeHostX11* g_current_capture; |
// A list of all (top-level) windows that have been created but not yet |
// destroyed. |
static std::list<XID>* open_windows_; |
- scoped_ptr<X11ScopedCapture> x11_capture_; |
+ scoped_ptr<X11CaptureWindow> capture_window_; |
base::string16 window_title_; |