Commit 55c31ae8 authored by Shengsong Tan's avatar Shengsong Tan Committed by Commit Bot

Add desktop focus state change event

This change add a new event for desktop window focus state change.
With this change, ARC can have different behavior when Chrome window
or ChromeOS desktop get activated.

BUG=b:171450038
TEST=Active different window between Chrome/ARC and logcat events

Change-Id: I11cee5d5279ad12524092518cadd05fff67bab72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2519686
Commit-Queue: Shengsong Tan <sstan@google.com>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827122}
parent caffa0a0
...@@ -1132,6 +1132,18 @@ class WaylandRemoteShell : public ash::TabletModeObserver, ...@@ -1132,6 +1132,18 @@ class WaylandRemoteShell : public ash::TabletModeObserver,
lost_active_surface_resource = nullptr; lost_active_surface_resource = nullptr;
} }
uint32_t focus_state;
if (gained_active_surface_resource) {
focus_state = ZCR_REMOTE_SHELL_V1_DESKTOP_FOCUS_STATE_CLIENT_FOCUSED;
} else if (gained_active) {
focus_state = ZCR_REMOTE_SHELL_V1_DESKTOP_FOCUS_STATE_OTHER_CLIENT_FOCUSED;
} else {
focus_state = ZCR_REMOTE_SHELL_V1_DESKTOP_FOCUS_STATE_NO_FOCUS;
}
zcr_remote_shell_v1_send_desktop_focus_state_changed(remote_shell_resource_,
focus_state);
zcr_remote_shell_v1_send_activated(remote_shell_resource_, zcr_remote_shell_v1_send_activated(remote_shell_resource_,
gained_active_surface_resource, gained_active_surface_resource,
lost_active_surface_resource); lost_active_surface_resource);
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
reset. reset.
</description> </description>
<interface name="zcr_remote_shell_v1" version="29"> <interface name="zcr_remote_shell_v1" version="30">
<description summary="remote_shell"> <description summary="remote_shell">
The global interface that allows clients to turn a wl_surface into a The global interface that allows clients to turn a wl_surface into a
"real window" which is remotely managed but can be stacked, activated "real window" which is remotely managed but can be stacked, activated
...@@ -274,6 +274,24 @@ ...@@ -274,6 +274,24 @@
<arg name="use_default_device_scale_factor" type="int" summary="0 if false"/> <arg name="use_default_device_scale_factor" type="int" summary="0 if false"/>
</request> </request>
<!-- Version 30 additions -->
<enum name="desktop_focus_state">
<description summary="desktop foucs state">
Desktop client window focus state.
</description>
<entry name="no_focus" value="1" summary="no window get focused"/>
<entry name="client_focused" value="2" summary="client window get focused"/>
<entry name="other_client_focused" value="3" summary="other client window get focused"/>
</enum>
<event name="desktop_focus_state_changed" since="30">
<description summary="desktop window focus state change">
Notifies client that the window focus state change.
</description>
<arg name="focus_state" type="uint"/>
</event>
</interface> </interface>
<interface name="zcr_remote_surface_v1" version="27"> <interface name="zcr_remote_surface_v1" version="27">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment