From f3f6e79eeca8924ff9cfea4b30006e5b782bc93e Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 13 Jun 2025 09:54:11 +0300 Subject: Return app ids with ".desktop" appended to Shell.Introspect This isn't the correct solution, but it seems to work often enough for window icons in the screencast dialog. --- src/niri.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/niri.rs b/src/niri.rs index 9498a379..fd4112e6 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -2184,7 +2184,7 @@ impl State { self.niri.dynamic_cast_id_for_portal.get(), gnome_shell_introspect::WindowProperties { title: String::from("niri Dynamic Cast Target"), - app_id: String::from("rs.bxt.niri"), + app_id: String::from("rs.bxt.niri.desktop"), }, ); @@ -2193,7 +2193,14 @@ impl State { let props = with_toplevel_role(mapped.toplevel(), |role| { gnome_shell_introspect::WindowProperties { title: role.title.clone().unwrap_or_default(), - app_id: role.app_id.clone().unwrap_or_default(), + app_id: role + .app_id + .as_ref() + // We don't do proper .desktop file tracking (it's quite involved), and + // Wayland windows can set any app id they want. However, this seems to + // work well enough in practice. + .map(|app_id| format!("{app_id}.desktop")) + .unwrap_or_default(), } }); -- cgit