linux: Fix parenting of select widget on Wayland (fixes #3937)

This commit is contained in:
Pedro de Carvalho Gomes
2025-05-29 16:45:12 +00:00
committed by Marshall Greenblatt
parent b36cb4fe56
commit 6bd53b6093

View File

@@ -273,7 +273,7 @@ index 077855979045d..69f369b06c29e 100644
return host ? host->GetAcceleratedWidget() : nullptr; return host ? host->GetAcceleratedWidget() : nullptr;
} }
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc
index a5114063ad742..9a4a1be60f6b5 100644 index a5114063ad742..e8254548b7d62 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc --- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc
@@ -193,6 +193,18 @@ Widget::MoveLoopResult DesktopWindowTreeHostLinux::RunMoveLoop( @@ -193,6 +193,18 @@ Widget::MoveLoopResult DesktopWindowTreeHostLinux::RunMoveLoop(
@@ -295,11 +295,13 @@ index a5114063ad742..9a4a1be60f6b5 100644
void DesktopWindowTreeHostLinux::DispatchEvent(ui::Event* event) { void DesktopWindowTreeHostLinux::DispatchEvent(ui::Event* event) {
// In Windows, the native events sent to chrome are separated into client // In Windows, the native events sent to chrome are separated into client
// and non-client versions of events, which we record on our LocatedEvent // and non-client versions of events, which we record on our LocatedEvent
@@ -333,6 +345,8 @@ void DesktopWindowTreeHostLinux::AddAdditionalInitProperties( @@ -333,6 +345,10 @@ void DesktopWindowTreeHostLinux::AddAdditionalInitProperties(
properties->wayland_app_id = params.wayland_app_id; properties->wayland_app_id = params.wayland_app_id;
+ if (!properties->parent_widget) {
+ properties->parent_widget = params.parent_widget; + properties->parent_widget = params.parent_widget;
+ }
+ +
DCHECK(!properties->x11_extension_delegate); DCHECK(!properties->x11_extension_delegate);
properties->x11_extension_delegate = this; properties->x11_extension_delegate = this;