Fix build with debug feature

This commit is contained in:
Ian Douglas Scott 2023-10-20 15:22:03 -07:00
parent 809eeafa6d
commit 7e74d8db0b
3 changed files with 18 additions and 25 deletions

View file

@ -447,7 +447,6 @@ where
#[cfg(feature = "debug")] #[cfg(feature = "debug")]
puffin::profile_function!(); puffin::profile_function!();
let theme = state.theme.cosmic();
let mut elements = cursor_elements(renderer, state, output, cursor_mode); let mut elements = cursor_elements(renderer, state, output, cursor_mode);
#[cfg(feature = "debug")] #[cfg(feature = "debug")]
@ -472,11 +471,11 @@ where
elements.push(fps_overlay.into()); elements.push(fps_overlay.into());
} }
if state.shell.outputs.first() == Some(output) { if state.shell.outputs().next() == Some(output) {
if let Some(profiler_overlay) = profiler_ui( if let Some(profiler_overlay) = profiler_ui(
state, state,
renderer.glow_renderer_mut(), renderer.glow_renderer_mut(),
Rectangle::from_loc_and_size((0, 0), output_geo.size), Rectangle::from_loc_and_size((0, 0), output_geo.size).as_logical(),
scale, scale,
) )
.map_err(<R as Renderer>::Error::from) .map_err(<R as Renderer>::Error::from)
@ -497,6 +496,8 @@ where
return Ok(elements); return Ok(elements);
} }
let theme = state.theme.cosmic();
let overview = state.shell.overview_mode(); let overview = state.shell.overview_mode();
let (resize_mode, resize_indicator) = state.shell.resize_mode(); let (resize_mode, resize_indicator) = state.shell.resize_mode();
let resize_indicator = resize_indicator.map(|indicator| (resize_mode, indicator)); let resize_indicator = resize_indicator.map(|indicator| (resize_mode, indicator));

View file

@ -327,17 +327,18 @@ fn format_pointer_focus(focus: Option<PointerFocusTarget>) -> String {
}, },
Some(Fullscreen(x)) => format!( Some(Fullscreen(x)) => format!(
"Fullscreen {} ({})", "Fullscreen {} ({})",
match x.surface() { match &x {
CosmicSurface::Wayland(w) => w.toplevel().wl_surface().id().protocol_id(), CosmicSurface::Wayland(w) => w.toplevel().wl_surface().id().protocol_id(),
CosmicSurface::X11(x) => x.window_id(), CosmicSurface::X11(x) => x.window_id(),
_ => unreachable!(), _ => unreachable!(),
}, },
x.surface().title() x.title()
), ),
Some(LayerSurface(x)) => format!("LayerSurface {}", x.wl_surface().id().protocol_id()), Some(LayerSurface(x)) => format!("LayerSurface {}", x.wl_surface().id().protocol_id()),
Some(Popup(x)) => format!("Popup {}", x.wl_surface().id().protocol_id()), Some(Popup(x)) => format!("Popup {}", x.wl_surface().id().protocol_id()),
Some(OverrideRedirect(x)) => format!("Override Redirect {}", x.window_id()), Some(OverrideRedirect(x)) => format!("Override Redirect {}", x.window_id()),
Some(PointerFocusTarget::ResizeFork(x)) => format!("Resize Fork {:?}", x.node), Some(PointerFocusTarget::ResizeFork(x)) => format!("Resize Fork {:?}", x.node),
Some(LockSurface(x)) => format!("LockSurface {}", x.wl_surface().id().protocol_id()),
None => format!("None"), None => format!("None"),
} }
} }
@ -369,16 +370,17 @@ fn format_keyboard_focus(focus: Option<KeyboardFocusTarget>) -> String {
}, },
Some(Fullscreen(x)) => format!( Some(Fullscreen(x)) => format!(
"Fullscreen {} ({})", "Fullscreen {} ({})",
match x.surface() { match &x {
CosmicSurface::Wayland(w) => w.toplevel().wl_surface().id().protocol_id(), CosmicSurface::Wayland(w) => w.toplevel().wl_surface().id().protocol_id(),
CosmicSurface::X11(x) => x.window_id(), CosmicSurface::X11(x) => x.window_id(),
_ => unreachable!(), _ => unreachable!(),
}, },
x.surface().title() x.title()
), ),
Some(LayerSurface(x)) => format!("LayerSurface {}", x.wl_surface().id().protocol_id()), Some(LayerSurface(x)) => format!("LayerSurface {}", x.wl_surface().id().protocol_id()),
Some(Popup(x)) => format!("Popup {}", x.wl_surface().id().protocol_id()), Some(Popup(x)) => format!("Popup {}", x.wl_surface().id().protocol_id()),
Some(Group(_)) => format!("Window Group"), Some(Group(_)) => format!("Window Group"),
Some(LockSurface(x)) => format!("LockSurface {}", x.wl_surface().id().protocol_id()),
None => format!("None"), None => format!("None"),
} }
} }

View file

@ -748,15 +748,10 @@ impl State {
} }
#[cfg(feature = "debug")] #[cfg(feature = "debug")]
if self.common.seats().position(|x| x == &seat).unwrap() == 0 { if self.common.seats().position(|x| x == &seat).unwrap() == 0 {
let location = if let Some(output) = self.common.shell.outputs.first() { if let Some(output) = self.common.shell.outputs().next() {
self.common let location = position.to_local(&output).to_i32_round().as_logical();
.shell self.common.egui.state.handle_pointer_motion(location);
.map_global_to_space(position, output) }
.to_i32_round()
} else {
position.to_i32_round()
};
self.common.egui.state.handle_pointer_motion(location);
} }
} }
} }
@ -808,15 +803,10 @@ impl State {
ptr.frame(self); ptr.frame(self);
#[cfg(feature = "debug")] #[cfg(feature = "debug")]
if self.common.seats().position(|x| x == &seat).unwrap() == 0 { if self.common.seats().position(|x| x == &seat).unwrap() == 0 {
let location = if let Some(output) = self.common.shell.outputs.first() { if let Some(output) = self.common.shell.outputs().next() {
self.common let location = position.to_local(&output).to_i32_round().as_logical();
.shell self.common.egui.state.handle_pointer_motion(location);
.map_global_to_space(position, output) }
.to_i32_round()
} else {
position.to_i32_round()
};
self.common.egui.state.handle_pointer_motion(location);
} }
} }
} }