Skip to content
Commit 143574a6 authored by Kramer Ge's avatar Kramer Ge Committed by Chromium LUCI CQ
Browse files

[Ozone/Wayland]Add WaylandBubble platform window for bubble widgets

WaylandBubble is backed by a wl_surface with wl_subsurface role. It will
receive input and layout related events, as well as delegated quads from
viz. Benefits of wl_subsurface over xdg_popup role:
- It doesn't have to follow back&forth configure<->acknowledgement flow
  with the wayland server, so tab hover cards can animate smoothly.
- It can control position/size/stacking/visibility of the bubble
  relative to the parent directly, whereas with the xdg_popup, where/how
  platform widgets are can be at the whims of the wayland server.
- xdg_popup appears to have its own set of rules when it comes to the
  focus, input capturing, and show/hide in relation to its parent which
  is not expected for every single kBubble widgets.
  e.g. ProfilePickerMenu does not seem to take activation from toplevel
  when using xdg_popup, and it doesn't get correct hover effects.

WaylandBubble can also have a WaylandPopup as child, since it does not
have an xdg_surface attachment, it defers to its parent to place/anchor
the popup.

From Lacros' point of view, only one of bubble/toplevel can have
activation, otherwise Chrome Vox will not draw focus ring correctly, so
at platform_window level we need to maintain the assumption to transfer
activation accordingly.
Note: From Wayland server's point of view only toplevel is activatable.

Requesting activations:
1) When a bubble requests activation, if the toplevel has the activation
   from the wayland server, transfer activation from toplevel to bubble.
2) When a bubble requests activation while an existing bubble is active,
   transfer activation from the currently active bubble to the new one.
3) When toplevel requests activation or requests deactivate, deactivate
   the bubble.

Platform moving activations:
4) When toplevel receives activation from the wayland server, if there
   is a bubble requested for activation previously, give activation to
   the bubble.
5) When toplevel loses activation from the wayland server, deactivate
   the bubble as well.

Input events moving activation to toplevel:
6) There are cases where input caused toplevel to gain activation but
   does not lead to it requesting activation through platform_window. So
   if the toplevel desktop_window_tree_host_platform gains activation,
   and it is not active, has child windows, then call Activate().

Bug: 1280332
Change-Id: Id1cacfb146984f2730b8379d827b7326cda70f4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5301619


Reviewed-by: default avatarYuzhu Shen <yzshen@chromium.org>
Reviewed-by: default avatarDana Fried <dfried@chromium.org>
Reviewed-by: default avatarThomas Lukaszewicz <tluk@chromium.org>
Reviewed-by: default avatarMaksim Sisov <msisov@igalia.com>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Kramer Ge <fangzhoug@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1280465}
parent 2981c634
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment