Return app ids with ".desktop" appended to Shell.Introspect
Browse files at this commitf3f6e79eeca8924ff9cfea4b30006e5b782bc93eParent: 83ec3691 changed file +9 -2
- src/niri.rs +9 -2
src/niri.rsmodified+9 -2
| @@ -2184,7 +2184,7 @@ impl State { | ||
| 2184 | 2184 | self.niri.dynamic_cast_id_for_portal.get(), |
| 2185 | 2185 | gnome_shell_introspect::WindowProperties { |
| 2186 | 2186 | title: String::from("niri Dynamic Cast Target"), |
| 2187 | - app_id: String::from("rs.bxt.niri"), | |
| 2187 | + app_id: String::from("rs.bxt.niri.desktop"), | |
| 2188 | 2188 | }, |
| 2189 | 2189 | ); |
| 2190 | 2190 | |
| @@ -2193,7 +2193,14 @@ impl State { | ||
| 2193 | 2193 | let props = with_toplevel_role(mapped.toplevel(), |role| { |
| 2194 | 2194 | gnome_shell_introspect::WindowProperties { |
| 2195 | 2195 | title: role.title.clone().unwrap_or_default(), |
| 2196 | - app_id: role.app_id.clone().unwrap_or_default(), | |
| 2196 | + app_id: role | |
| 2197 | + .app_id | |
| 2198 | + .as_ref() | |
| 2199 | + // We don't do proper .desktop file tracking (it's quite involved), and | |
| 2200 | + // Wayland windows can set any app id they want. However, this seems to | |
| 2201 | + // work well enough in practice. | |
| 2202 | + .map(|app_id| format!("{app_id}.desktop")) | |
| 2203 | + .unwrap_or_default(), | |
| 2197 | 2204 | } |
| 2198 | 2205 | }); |
| 2199 | 2206 |