diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-06-13 09:54:11 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-06-13 09:55:08 +0300 |
| commit | f3f6e79eeca8924ff9cfea4b30006e5b782bc93e (patch) | |
| tree | e36acd2cd8cc2f28e8524be4ff74e6c039d3cef6 /src | |
| parent | 83ec36953611ab11dd36c3c3632db7bd3fea9b82 (diff) | |
| download | niri-f3f6e79eeca8924ff9cfea4b30006e5b782bc93e.tar.gz niri-f3f6e79eeca8924ff9cfea4b30006e5b782bc93e.tar.bz2 niri-f3f6e79eeca8924ff9cfea4b30006e5b782bc93e.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/niri.rs | 11 |
1 files changed, 9 insertions, 2 deletions
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(), } }); |
