Commit 97692bbb authored by Hiroki Sato's avatar Hiroki Sato Committed by Commit Bot

Fix the immersive flag mapping

In a fullscreen (user immersive) mode, the shelf visibility state is
SHELF_HIDDEN, and the client expects the state to be mapped into auto
hide.

Bug: b:172022584
Test: manual. follow the step in the bug, shelf is correctly handled on fullscreen.
Change-Id: Ic492638b1a0391d2641941bd37c2bf8eac36c99c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2509310Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Hiroki Sato <hirokisato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825231}
parent d71f8161
...@@ -140,6 +140,20 @@ ash::ShelfLayoutManager* GetShelfLayoutManagerForDisplay( ...@@ -140,6 +140,20 @@ ash::ShelfLayoutManager* GetShelfLayoutManagerForDisplay(
return ash::Shelf::ForWindow(root)->shelf_layout_manager(); return ash::Shelf::ForWindow(root)->shelf_layout_manager();
} }
int SystemUiVisibility(const display::Display& display) {
auto* shelf_layout_manager = GetShelfLayoutManagerForDisplay(display);
switch (shelf_layout_manager->visibility_state()) {
case ash::SHELF_VISIBLE:
return ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_VISIBLE;
case ash::SHELF_AUTO_HIDE:
case ash::SHELF_HIDDEN:
return ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_AUTOHIDE_NON_STICKY;
}
NOTREACHED() << "Got unexpected shelf visibility state "
<< shelf_layout_manager->visibility_state();
return 0;
}
int Component(uint32_t direction) { int Component(uint32_t direction) {
switch (direction) { switch (direction) {
case ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_NONE: case ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_NONE:
...@@ -805,11 +819,7 @@ class WaylandRemoteOutput : public WaylandDisplayObserver { ...@@ -805,11 +819,7 @@ class WaylandRemoteOutput : public WaylandDisplayObserver {
resource_, stable_insets_in_pixel.left(), stable_insets_in_pixel.top(), resource_, stable_insets_in_pixel.left(), stable_insets_in_pixel.top(),
stable_insets_in_pixel.right(), stable_insets_in_pixel.bottom()); stable_insets_in_pixel.right(), stable_insets_in_pixel.bottom());
auto* shelf_layout_manager = GetShelfLayoutManagerForDisplay(display); int systemui_visibility = SystemUiVisibility(display);
int systemui_visibility =
shelf_layout_manager->visibility_state() == ash::SHELF_AUTO_HIDE
? ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_AUTOHIDE_NON_STICKY
: ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_VISIBLE;
zcr_remote_output_v1_send_systemui_visibility(resource_, zcr_remote_output_v1_send_systemui_visibility(resource_,
systemui_visibility); systemui_visibility);
...@@ -1032,8 +1042,6 @@ class WaylandRemoteShell : public ash::TabletModeObserver, ...@@ -1032,8 +1042,6 @@ class WaylandRemoteShell : public ash::TabletModeObserver,
} }
if (wl_resource_get_version(remote_shell_resource_) >= 20) { if (wl_resource_get_version(remote_shell_resource_) >= 20) {
auto* shelf_layout_manager = GetShelfLayoutManagerForDisplay(display);
// Apply the scale factor used on the remote shell client (ARC). // Apply the scale factor used on the remote shell client (ARC).
const gfx::Rect& bounds = display.bounds(); const gfx::Rect& bounds = display.bounds();
...@@ -1059,10 +1067,7 @@ class WaylandRemoteShell : public ash::TabletModeObserver, ...@@ -1059,10 +1067,7 @@ class WaylandRemoteShell : public ash::TabletModeObserver,
MaybeApplyCTSHack(layout_mode_, size_in_pixel, &insets_in_client_pixel, MaybeApplyCTSHack(layout_mode_, size_in_pixel, &insets_in_client_pixel,
&stable_insets_in_client_pixel); &stable_insets_in_client_pixel);
int systemui_visibility = int systemui_visibility = SystemUiVisibility(display);
shelf_layout_manager->visibility_state() == ash::SHELF_AUTO_HIDE
? ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_AUTOHIDE_NON_STICKY
: ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_VISIBLE;
zcr_remote_shell_v1_send_workspace_info( zcr_remote_shell_v1_send_workspace_info(
remote_shell_resource_, display_id_hi, display_id_lo, x_px, y_px, remote_shell_resource_, display_id_hi, display_id_lo, x_px, y_px,
......
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