MCPcopy Create free account
hub / github.com/MagmaWM/MagmaWM / format_focus

Function format_focus

src/debug.rs:269–295  ·  view source on GitHub ↗
(focus: Option<FocusTarget>)

Source from the content-addressed store, hash-verified

267}
268
269fn 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)]
298pub struct Fps {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected