From 7008e15400889602bc409db37ce8dee0df71c2cd Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Wed, 22 Jan 2025 22:21:49 +0100 Subject: [PATCH] desktop: Associate Ruffle window with Ruffle This patch associates the main window created by Ruffle with the Ruffle application by its ID. This fixes issues on some desktops (KDE, Wayland) where the window is not being recognized as Ruffle. --- desktop/src/app.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/desktop/src/app.rs b/desktop/src/app.rs index 48b5b4c74a9c..c9e2ba82c099 100644 --- a/desktop/src/app.rs +++ b/desktop/src/app.rs @@ -439,12 +439,18 @@ impl ApplicationHandler for App { let preferred_height = self.preferences.cli.height; let start_fullscreen = self.preferences.cli.fullscreen; - let window_attributes = WindowAttributes::default() + let mut window_attributes = WindowAttributes::default() .with_visible(false) .with_title("Ruffle") .with_window_icon(Some(icon)) .with_min_inner_size(min_window_size); + #[cfg(target_os = "linux")] + { + use winit::platform::wayland::WindowAttributesExtWayland; + window_attributes = window_attributes.with_name("rs.ruffle.Ruffle", "main"); + } + let event_loop_proxy = self.event_loop_proxy.clone(); let preferences = self.preferences.clone(); let window = event_loop