Skip to content

Commit a16b487

Browse files
Nexus: Add full z-order support OS-20183
1 parent 0c2b7d5 commit a16b487

3 files changed

Lines changed: 166 additions & 0 deletions

File tree

patches/chromium/.patches

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,5 @@ add_mse_support_to_brightsign_video_player_os-19598.patch
201201
feat_enable_hls_support_when_brightsign_media_player_is_enabled.patch
202202
feat_add_video_audio-codecs-supported_flag_support.patch
203203
os-20183-move-z-order-management-to-the-compositor.patch
204+
nexus_window-Only-update-window-properties-that-actu.patch
205+
nexus_window-Add-full-z-order-support-OS-20183.patch
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
From 5fc948128766ac57706fb26acdd9e370b8a772c4 Mon Sep 17 00:00:00 2001
2+
From: Ray Smith <[email protected]>
3+
Date: Mon, 9 Feb 2026 13:07:52 +0000
4+
Subject: [PATCH 2/2] nexus_window: Add full z-order support OS-20183
5+
6+
HTML and other graphics widget z-ordering is now handled in the
7+
compositor. Plumb through the raise/lower commands to the compositor.
8+
9+
Since the virtual keyboard is always on top, we just have to set its
10+
special role and the compositor ensures it appears in the right place in
11+
the z-order.
12+
---
13+
ui/ozone/platform/nexus/nexus_window.cc | 28 +++++++++++++++++++++----
14+
ui/ozone/platform/nexus/nexus_window.h | 1 +
15+
2 files changed, 25 insertions(+), 4 deletions(-)
16+
17+
diff --git a/ui/ozone/platform/nexus/nexus_window.cc b/ui/ozone/platform/nexus/nexus_window.cc
18+
index 654ff513dc..3110546a61 100644
19+
--- a/ui/ozone/platform/nexus/nexus_window.cc
20+
+++ b/ui/ozone/platform/nexus/nexus_window.cc
21+
@@ -55,9 +55,6 @@ const NEXUS_BlendEquation ShowSourceColor = {
22+
NEXUS_BlendFactor_eZero
23+
};
24+
25+
-// Define z-order as constant
26+
-const int kZOrder = 100;
27+
-
28+
namespace ui {
29+
30+
NexusWindow::NexusWindow(PlatformWindowDelegate* delegate,
31+
@@ -81,7 +78,6 @@ NexusWindow::NexusWindow(PlatformWindowDelegate* delegate,
32+
win_info.y = bounds_.y();
33+
win_info.width = bounds_.width();
34+
win_info.height = bounds_.height();
35+
- win_info.zOrder = kZOrder;
36+
win_info.colorBlend = HideSourceColor;
37+
win_info.alphaBlend = HideSourceAlpha;
38+
native_window_ = NXPL_CreateNativeWindowEXT(&win_info);
39+
@@ -478,4 +474,28 @@ void NexusWindow::SetOpacity(float opacity) {
40+
}
41+
}
42+
43+
+void NexusWindow::SetZOrderLevel(ZOrderLevel order) {
44+
+ BS_DEBUG( "%s order: %d\n", __PRETTY_FUNCTION__, static_cast<int>(order));
45+
+
46+
+ NXPL_NativeWindowInfoEXT win_info;
47+
+ NXPL_GetNativeWindowInfoEXT(native_window_, &win_info);
48+
+ switch (order) {
49+
+ case ZOrderLevel::kRaise:
50+
+ win_info.roleAction = NEXUS_BrightSignSurfaceAction_eRaise;
51+
+ break;
52+
+ case ZOrderLevel::kLower:
53+
+ win_info.roleAction = NEXUS_BrightSignSurfaceAction_eLower;
54+
+ break;
55+
+ case ZOrderLevel::kRoleGraphics:
56+
+ win_info.role = NEXUS_BrightSignSurfaceRole_eGraphics;
57+
+ break;
58+
+ case ZOrderLevel::kRoleVirtualKeyboard:
59+
+ win_info.role = NEXUS_BrightSignSurfaceRole_eVirtualKeyboard;
60+
+ break;
61+
+ default:
62+
+ break;
63+
+ }
64+
+ NXPL_UpdateNativeWindowEXT(native_window_, &win_info);
65+
+}
66+
+
67+
} // namespace ui
68+
diff --git a/ui/ozone/platform/nexus/nexus_window.h b/ui/ozone/platform/nexus/nexus_window.h
69+
index 9b3a965a8a..3cf0278c09 100644
70+
--- a/ui/ozone/platform/nexus/nexus_window.h
71+
+++ b/ui/ozone/platform/nexus/nexus_window.h
72+
@@ -79,6 +79,7 @@ class NexusWindow : public PlatformWindow, public PlatformEventDispatcher {
73+
virtual bool IsTranslucentWindowOpacitySupported() const override;
74+
virtual bool ShouldWindowContentsBeTransparent() const override;
75+
virtual void SetOpacity(float opacity) override;
76+
+ virtual void SetZOrderLevel(ZOrderLevel order) override;
77+
78+
void UpdateBounds(const gfx::Rect& bounds);
79+
void OnMouseEnter();
80+
--
81+
2.30.2
82+
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
From e578fb7405c399d7ac98bb5889a8f0f145c9a092 Mon Sep 17 00:00:00 2001
2+
From: Ray Smith <[email protected]>
3+
Date: Mon, 9 Feb 2026 12:55:09 +0000
4+
Subject: [PATCH 1/2] nexus_window: Only update window properties that actually
5+
change
6+
7+
Now that NXPL_GetNativeWindowInfoEXT works properly, we don't need to
8+
re-apply bounds, zorder etc. in unrelated functions.
9+
---
10+
ui/ozone/platform/nexus/nexus_window.cc | 31 ++++---------------------
11+
1 file changed, 4 insertions(+), 27 deletions(-)
12+
13+
diff --git a/ui/ozone/platform/nexus/nexus_window.cc b/ui/ozone/platform/nexus/nexus_window.cc
14+
index e126a07d15..654ff513dc 100644
15+
--- a/ui/ozone/platform/nexus/nexus_window.cc
16+
+++ b/ui/ozone/platform/nexus/nexus_window.cc
17+
@@ -110,12 +110,7 @@ void NexusWindow::Show(bool inactive) {
18+
BS_DEBUG( "%s\n", __PRETTY_FUNCTION__);
19+
visible_ = true;
20+
NXPL_NativeWindowInfoEXT win_info;
21+
- NXPL_GetDefaultNativeWindowInfoEXT(&win_info);
22+
- win_info.x = bounds_.x();
23+
- win_info.y = bounds_.y();
24+
- win_info.width = bounds_.width();
25+
- win_info.height = bounds_.height();
26+
- win_info.zOrder = kZOrder;
27+
+ NXPL_GetNativeWindowInfoEXT(native_window_, &win_info);
28+
29+
// Apply current opacity when showing
30+
if (opacity_ == 1.0f) {
31+
@@ -153,12 +148,7 @@ void NexusWindow::Hide() {
32+
BS_DEBUG( "%s\n", __PRETTY_FUNCTION__);
33+
visible_ = false;
34+
NXPL_NativeWindowInfoEXT win_info;
35+
- NXPL_GetDefaultNativeWindowInfoEXT(&win_info);
36+
- win_info.x = bounds_.x();
37+
- win_info.y = bounds_.y();
38+
- win_info.width = bounds_.width();
39+
- win_info.height = bounds_.height();
40+
- win_info.zOrder = kZOrder;
41+
+ NXPL_GetNativeWindowInfoEXT(native_window_, &win_info);
42+
win_info.colorBlend = HideSourceColor;
43+
win_info.alphaBlend = HideSourceAlpha;
44+
NXPL_UpdateNativeWindowEXT(native_window_, &win_info);
45+
@@ -200,19 +190,11 @@ void NexusWindow::SetBoundsInPixels(const gfx::Rect& bounds) {
46+
if (adjusted_bounds != bounds_)
47+
{
48+
NXPL_NativeWindowInfoEXT win_info;
49+
- NXPL_GetDefaultNativeWindowInfoEXT(&win_info);
50+
+ NXPL_GetNativeWindowInfoEXT(native_window_, &win_info);
51+
win_info.x = adjusted_bounds.x();
52+
win_info.y = adjusted_bounds.y();
53+
win_info.width = adjusted_bounds.width();
54+
win_info.height = adjusted_bounds.height();
55+
- win_info.zOrder = kZOrder;
56+
- if (!visible_ ) {
57+
- win_info.colorBlend = HideSourceColor;
58+
- win_info.alphaBlend = HideSourceAlpha;
59+
- }
60+
- else {
61+
- win_info.colorBlend = ShowSourceColor;
62+
- }
63+
NXPL_UpdateNativeWindowEXT(native_window_, &win_info);
64+
65+
bounds_ = adjusted_bounds;
66+
@@ -455,12 +437,7 @@ void NexusWindow::SetOpacity(float opacity) {
67+
// Update the window with new opacity settings
68+
if (native_window_) {
69+
NXPL_NativeWindowInfoEXT win_info;
70+
- NXPL_GetDefaultNativeWindowInfoEXT(&win_info);
71+
- win_info.x = bounds_.x();
72+
- win_info.y = bounds_.y();
73+
- win_info.width = bounds_.width();
74+
- win_info.height = bounds_.height();
75+
- win_info.zOrder = kZOrder;
76+
+ NXPL_GetNativeWindowInfoEXT(native_window_, &win_info);
77+
78+
if (!visible_ || opacity_ == 0.0f) {
79+
// Hidden or fully transparent
80+
--
81+
2.30.2
82+

0 commit comments

Comments
 (0)