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..d70734ed022a0c06fff03548351345fc3e1cffc0 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,20 @@ 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(); |
+ |
+ // Called on an XEnterWindowEvent, XLeaveWindowEvent, XIEnterEvent, or an |
+ // XILeaveEvent. |
+ void OnCrossingEvent(bool enter, bool focus, int detail); |
+ |
+ // Called on an XFocusInEvent, XFocusOutEvent, XIFocusInEvent, or an |
+ // XIFocusOutEvent. |
+ void OnFocusEvent(bool focus_in, int mode, int detail); |
+ |
// Makes a round trip to the X server to get the enclosing workspace for this |
// window. Returns true iff |workspace_| was changed. |
bool UpdateWorkspace(); |
@@ -266,6 +276,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 |
bool window_mapped_; |
// Should we wait for an UnmapNotify before trying to remap the window? |
+ // If |wait_for_unmap_| is true, we have sent an XUnmapWindow request to the |
+ // server and have yet to receive an UnmapNotify. |
bool wait_for_unmap_; |
// The bounds of |xwindow_|. |
@@ -358,6 +370,40 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 |
bool activatable_; |
+ // The focus-tracking state variables are as described in |
+ // gtk/docs/focus_tracking.txt |
+ // |
+ // |xwindow_| will receive input iff: |
+ // |has_focus_| || |has_pointer_focus_| |
+ |
+ // Is the pointer in |xwindow_| or one of its children? |
+ bool has_pointer_; |
+ |
+ // Does |xwindow_| have the pointer grab? This does not necessarily indicate |
+ // |xwindow_| has the keyboard grab. This is not part of the focus-tracking |
+ // state, but is only used to figure out when to call OnHostLostMouseGrab. |
+ bool has_pointer_grab_; |
+ |
+ // (An ancestor window or the PointerRoot 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. |
+ bool has_window_focus_; |
+ |
+ // |has_window_focus_| || (|xwindow_| has some sort of grab) |
+ bool has_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_; |