diff --git a/src/backend/render/mod.rs b/src/backend/render/mod.rs index d192c472..3ff3f0b8 100644 --- a/src/backend/render/mod.rs +++ b/src/backend/render/mod.rs @@ -1142,11 +1142,9 @@ where CosmicElement: RenderElement, CosmicMappedRenderElement: RenderElement, WorkspaceRenderElement: RenderElement, - if let Some(rd) = fps.rd.as_mut() { - rd.start_frame_capture( - std::ptr::null(), - ); - } +{ + if let Some(ref mut fps) = fps { + fps.start(); } let mut elements: Vec> = workspace_elements( @@ -1189,15 +1187,5 @@ where fps.render(); } - #[cfg(feature = "debug")] - if let Some(ref mut fps) = fps { - if let Some(rd) = fps.rd.as_mut() { - rd.end_frame_capture( - renderer.glow_renderer().egl_context().get_context_handle(), - std::ptr::null(), - ); - } - } - res.map(|res| (res, elements)) } diff --git a/src/input/mod.rs b/src/input/mod.rs index c93c6ca5..fd48373b 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -153,10 +153,6 @@ impl State { &TabletDescriptor::from(&device), ); } - #[cfg(feature = "debug")] - { - self.common.egui.state.handle_device_added(&device); - } } InputEvent::DeviceRemoved { device } => { for seat in &mut self.common.shell.read().unwrap().seats.iter() { @@ -173,10 +169,6 @@ impl State { break; } } - #[cfg(feature = "debug")] - { - self.common.egui.state.handle_device_removed(&device); - } } InputEvent::Keyboard { event, .. } => { use smithay::backend::input::KeyboardKeyEvent; @@ -419,25 +411,6 @@ impl State { } } - // Pass keys to debug interface, if it has focus - #[cfg(feature = "debug")] - { - if shell.seats.iter().position(|x| x == &seat).unwrap() == 0 - && data.common.egui.active - { - if data.common.egui.state.wants_keyboard() { - data.common.egui.state.handle_keyboard( - &handle, - state == KeyState::Pressed, - modifiers.clone(), - ); - seat.supressed_keys() - .add(&handle, None); - return FilterResult::Intercept(None); - } - } - } - // Handle VT switches if state == KeyState::Pressed && (Keysym::XF86_Switch_VT_1.raw() ..= Keysym::XF86_Switch_VT_12.raw()) @@ -695,13 +668,6 @@ impl State { session.set_cursor_pos(Some(geometry.loc)); } } - #[cfg(feature = "debug")] - if shell.seats().position(|x| x == &seat).unwrap() == 0 { - if let Some(output) = shell.outputs().next() { - let location = position.to_local(&output).to_i32_round().as_logical(); - self.common.egui.state.handle_pointer_motion(location); - } - } } } InputEvent::PointerMotionAbsolute { event, .. } => { @@ -768,13 +734,6 @@ impl State { session.set_cursor_pos(Some(geometry.loc)); } } - #[cfg(feature = "debug")] - if shell.seats.iter().position(|x| x == &seat).unwrap() == 0 { - if let Some(output) = shell.outputs().next() { - let location = position.to_local(&output).to_i32_round().as_logical(); - self.common.egui.state.handle_pointer_motion(location); - } - } } } InputEvent::PointerButton { event, .. } => { @@ -783,20 +742,6 @@ impl State { let mut shell = self.common.shell.write().unwrap(); if let Some(seat) = shell.seats.for_device(&event.device()).cloned() { self.common.idle_notifier_state.notify_activity(&seat); - #[cfg(feature = "debug")] - if shell.seats.iter().position(|x| x == &seat).unwrap() == 0 - && self.common.egui.active - { - if self.common.egui.state.wants_pointer() { - if let Some(button) = event.button() { - self.common.egui.state.handle_pointer_button( - button, - event.state() == ButtonState::Pressed, - ); - } - return; - } - } let serial = SERIAL_COUNTER.next_serial(); let button = event.button_code(); @@ -999,39 +944,6 @@ impl State { .cloned(); if let Some(seat) = maybe_seat { self.common.idle_notifier_state.notify_activity(&seat); - #[cfg(feature = "debug")] - if self - .common - .shell - .read() - .unwrap() - .seats - .iter() - .position(|x| x == &seat) - .unwrap() - == 0 - && self.common.egui.active - { - if self.common.egui.state.wants_pointer() { - self.common.egui.state.handle_pointer_axis( - event - .amount_v120(Axis::Horizontal) - .or_else(|| { - event.amount(Axis::Horizontal).map(|x| x * 3.0 * 120.0) - }) - .unwrap_or(0.0) - / 120.0, - event - .amount_v120(Axis::Vertical) - .or_else(|| { - event.amount(Axis::Vertical).map(|x| x * 3.0 * 120.0) - }) - .unwrap_or(0.0) - / 120.0, - ); - return; - } - } let mut frame = AxisFrame::new(event.time_msec()).source(event.source()); if let Some(horizontal_amount) = event.amount(Axis::Horizontal) { diff --git a/src/state.rs b/src/state.rs index 303451fd..480b882e 100644 --- a/src/state.rs +++ b/src/state.rs @@ -186,9 +186,6 @@ pub struct Common { pub kiosk_child: Option, pub theme: cosmic::Theme, - #[cfg(feature = "debug")] - pub egui: Egui, - // wayland state pub compositor_state: CompositorState, pub data_device_state: DataDeviceState, @@ -516,15 +513,6 @@ impl State { kiosk_child: None, theme: cosmic::theme::system_preference(), - #[cfg(feature = "debug")] - egui: Egui { - active: false, - state: smithay_egui::EguiState::new(Rectangle::from_loc_and_size( - (0, 0), - (800, 600), - )), - }, - compositor_state, data_device_state, dmabuf_state, @@ -971,13 +959,6 @@ impl Common { } } -#[cfg(feature = "debug")] -#[derive(Debug)] -pub struct Egui { - pub active: bool, - pub state: smithay_egui::EguiState, -} - #[derive(Debug)] pub struct Fps { #[cfg(feature = "debug")] diff --git a/src/wayland/handlers/screencopy/render.rs b/src/wayland/handlers/screencopy/render.rs index 3ddb2d3a..fc16e79a 100644 --- a/src/wayland/handlers/screencopy/render.rs +++ b/src/wayland/handlers/screencopy/render.rs @@ -149,9 +149,6 @@ where Vec>, ) -> Result, DTError>, { - #[cfg(feature = "debug")] - puffin::profile_function!(); - let mut session_damage_tracking = session.lock().unwrap(); let buffer = frame.buffer(); @@ -186,9 +183,6 @@ pub fn render_workspace_to_buffer( frame: Frame, handle: WorkspaceHandle, ) { - #[cfg(feature = "debug")] - puffin::profile_function!(); - let shell = state.common.shell.read().unwrap(); let Some(workspace) = shell.workspaces.space_for_handle(&handle) else { session.stop(); @@ -455,9 +449,6 @@ pub fn render_window_to_buffer( frame: Frame, toplevel: &CosmicSurface, ) { - #[cfg(feature = "debug")] - puffin::profile_function!(); - if !toplevel.alive() { session.stop(); return;