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 b648c0062a7517f66db480ce0221e8f825effacd..56718061ccd4050235fc929d5c59f9b9dbd763bf 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 |
@@ -72,10 +72,6 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 |
// otherwise. |
::Region GetWindowShape() const; |
- // Called by X11DesktopHandler to notify us that the native windowing system |
- // has changed our activation. |
- void HandleNativeWidgetActivationChanged(bool active); |
- |
void AddObserver(views::DesktopWindowTreeHostObserverX11* observer); |
void RemoveObserver(views::DesktopWindowTreeHostObserverX11* observer); |
@@ -186,6 +182,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 |
// Called when |xwindow_|'s _NET_FRAME_EXTENTS property is updated. |
void OnFrameExtentsUpdated(); |
+ // Record the activation state. |
+ void BeforeActivationStateChanged(); |
+ |
+ // Handle the state change since BeforeActivationStateChanged(). |
+ void AfterActivationStateChanged(); |
+ |
// Makes a round trip to the X server to get the enclosing workspace for this |
// window. Returns true iff |workspace_| was changed. |
bool UpdateWorkspace(); |
@@ -196,6 +198,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 |
// Updates |xwindow_|'s _NET_WM_USER_TIME if |xwindow_| is active. |
void UpdateWMUserTime(const ui::PlatformEvent& event); |
+ // Gets the last seen server timestamp. Avoids returning CurrentTime. |
+ Time GetTimestamp(); |
+ |
// Sends a message to the x11 window manager, enabling or disabling the |
// states |state1| and |state2|. |
void SetWMSpecState(bool enabled, ::Atom state1, ::Atom state2); |
@@ -358,6 +363,35 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 |
bool activatable_; |
+ // The focus-tracking state variables are as described in |
+ // gtk/docs/focus_tracking.txt |
+ |
+ // Is the pointer in |xwindow_| or one of its children? |
+ bool has_pointer_; |
+ |
+ // Does |xwindow_| have the pointer grab? This does not necissarily indicate |
danakj
2016/08/11 21:48:20
typo
Tom (Use chromium acct)
2016/08/15 18:42:46
Done.
|
+ // |xwindow_| has the keyboard grab. |
+ bool has_pointer_grab_; |
+ |
+ // (An ancestor window is focused) && |has_pointer_| |
+ bool has_pointer_focus_; |
+ |
+ // Is |xwindow_| or one of its children focused? |
+ // |has_window_focus_| and |has_pointer_focus_| are mutually exclusive. |
danakj
2016/08/11 21:48:20
nit: don't line wrap for every sentence
Tom (Use chromium acct)
2016/08/15 18:42:46
Done.
|
+ // |xwindow_| will receive in put iff: |
danakj
2016/08/11 21:48:20
input
Tom (Use chromium acct)
2016/08/15 18:42:46
Done.
|
+ // |has_window_focus_| || |has_pointer_grab_| || |has_pointer_focus_| |
danakj
2016/08/11 21:48:20
nit: indent this a bit will read easier
Tom (Use chromium acct)
2016/08/15 18:42:46
Done.
|
+ bool has_window_focus_; |
+ |
+ // X11 does not support deactivating windows; you can only activate a |
+ // different window. If we would like to be deactivated, we just ignore |
+ // input we no longer care about. |
+ bool ignore_input_; |
+ |
+ // Used for tracking activation state in {Before|After}ActivationStateChanged. |
+ bool was_active_; |
+ bool had_pointer_grab_; |
+ bool had_window_focus_; |
+ |
base::CancelableCallback<void()> delayed_resize_task_; |
base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; |