(focus: Option<FocusTarget>)
| 267 | } |
| 268 | |
| 269 | fn format_focus(focus: Option<FocusTarget>) -> String { |
| 270 | if let Some(focus) = focus { |
| 271 | match focus { |
| 272 | FocusTarget::Window(w) => format!( |
| 273 | "Window {} ({})", |
| 274 | w.toplevel().unwrap().wl_surface().id().protocol_id(), |
| 275 | with_states(w.toplevel().unwrap().wl_surface(), |states| { |
| 276 | states |
| 277 | .data_map |
| 278 | .get::<XdgToplevelSurfaceData>() |
| 279 | .unwrap() |
| 280 | .lock() |
| 281 | .unwrap() |
| 282 | .title |
| 283 | .clone() |
| 284 | .unwrap_or_default() |
| 285 | }) |
| 286 | ), |
| 287 | FocusTarget::LayerSurface(l) => { |
| 288 | format!("LayerSurface {}", l.wl_surface().id().protocol_id()) |
| 289 | } |
| 290 | FocusTarget::Popup(p) => format!("Popup {}", p.wl_surface().id().protocol_id()), |
| 291 | } |
| 292 | } else { |
| 293 | "None".to_string() |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | #[derive(Default)] |
| 298 | pub struct Fps { |
nothing calls this directly
no outgoing calls
no test coverage detected