debug: Drop puffin, interactivity, renderdoc
This commit is contained in:
parent
cf0b0f9d2d
commit
3b7bba3add
4 changed files with 3 additions and 131 deletions
|
|
@ -1142,11 +1142,9 @@ where
|
||||||
CosmicElement<R>: RenderElement<R>,
|
CosmicElement<R>: RenderElement<R>,
|
||||||
CosmicMappedRenderElement<R>: RenderElement<R>,
|
CosmicMappedRenderElement<R>: RenderElement<R>,
|
||||||
WorkspaceRenderElement<R>: RenderElement<R>,
|
WorkspaceRenderElement<R>: RenderElement<R>,
|
||||||
if let Some(rd) = fps.rd.as_mut() {
|
{
|
||||||
rd.start_frame_capture(
|
if let Some(ref mut fps) = fps {
|
||||||
std::ptr::null(),
|
fps.start();
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut elements: Vec<CosmicElement<R>> = workspace_elements(
|
let mut elements: Vec<CosmicElement<R>> = workspace_elements(
|
||||||
|
|
@ -1189,15 +1187,5 @@ where
|
||||||
fps.render();
|
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))
|
res.map(|res| (res, elements))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,10 +153,6 @@ impl State {
|
||||||
&TabletDescriptor::from(&device),
|
&TabletDescriptor::from(&device),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#[cfg(feature = "debug")]
|
|
||||||
{
|
|
||||||
self.common.egui.state.handle_device_added(&device);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
InputEvent::DeviceRemoved { device } => {
|
InputEvent::DeviceRemoved { device } => {
|
||||||
for seat in &mut self.common.shell.read().unwrap().seats.iter() {
|
for seat in &mut self.common.shell.read().unwrap().seats.iter() {
|
||||||
|
|
@ -173,10 +169,6 @@ impl State {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(feature = "debug")]
|
|
||||||
{
|
|
||||||
self.common.egui.state.handle_device_removed(&device);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
InputEvent::Keyboard { event, .. } => {
|
InputEvent::Keyboard { event, .. } => {
|
||||||
use smithay::backend::input::KeyboardKeyEvent;
|
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
|
// Handle VT switches
|
||||||
if state == KeyState::Pressed
|
if state == KeyState::Pressed
|
||||||
&& (Keysym::XF86_Switch_VT_1.raw() ..= Keysym::XF86_Switch_VT_12.raw())
|
&& (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));
|
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, .. } => {
|
InputEvent::PointerMotionAbsolute { event, .. } => {
|
||||||
|
|
@ -768,13 +734,6 @@ impl State {
|
||||||
session.set_cursor_pos(Some(geometry.loc));
|
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, .. } => {
|
InputEvent::PointerButton { event, .. } => {
|
||||||
|
|
@ -783,20 +742,6 @@ impl State {
|
||||||
let mut shell = self.common.shell.write().unwrap();
|
let mut shell = self.common.shell.write().unwrap();
|
||||||
if let Some(seat) = shell.seats.for_device(&event.device()).cloned() {
|
if let Some(seat) = shell.seats.for_device(&event.device()).cloned() {
|
||||||
self.common.idle_notifier_state.notify_activity(&seat);
|
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 serial = SERIAL_COUNTER.next_serial();
|
||||||
let button = event.button_code();
|
let button = event.button_code();
|
||||||
|
|
@ -999,39 +944,6 @@ impl State {
|
||||||
.cloned();
|
.cloned();
|
||||||
if let Some(seat) = maybe_seat {
|
if let Some(seat) = maybe_seat {
|
||||||
self.common.idle_notifier_state.notify_activity(&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());
|
let mut frame = AxisFrame::new(event.time_msec()).source(event.source());
|
||||||
if let Some(horizontal_amount) = event.amount(Axis::Horizontal) {
|
if let Some(horizontal_amount) = event.amount(Axis::Horizontal) {
|
||||||
|
|
|
||||||
19
src/state.rs
19
src/state.rs
|
|
@ -186,9 +186,6 @@ pub struct Common {
|
||||||
pub kiosk_child: Option<Child>,
|
pub kiosk_child: Option<Child>,
|
||||||
pub theme: cosmic::Theme,
|
pub theme: cosmic::Theme,
|
||||||
|
|
||||||
#[cfg(feature = "debug")]
|
|
||||||
pub egui: Egui,
|
|
||||||
|
|
||||||
// wayland state
|
// wayland state
|
||||||
pub compositor_state: CompositorState,
|
pub compositor_state: CompositorState,
|
||||||
pub data_device_state: DataDeviceState,
|
pub data_device_state: DataDeviceState,
|
||||||
|
|
@ -516,15 +513,6 @@ impl State {
|
||||||
kiosk_child: None,
|
kiosk_child: None,
|
||||||
theme: cosmic::theme::system_preference(),
|
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,
|
compositor_state,
|
||||||
data_device_state,
|
data_device_state,
|
||||||
dmabuf_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)]
|
#[derive(Debug)]
|
||||||
pub struct Fps {
|
pub struct Fps {
|
||||||
#[cfg(feature = "debug")]
|
#[cfg(feature = "debug")]
|
||||||
|
|
|
||||||
|
|
@ -149,9 +149,6 @@ where
|
||||||
Vec<Rectangle<i32, BufferCoords>>,
|
Vec<Rectangle<i32, BufferCoords>>,
|
||||||
) -> Result<RenderOutputResult<'d>, DTError<R>>,
|
) -> Result<RenderOutputResult<'d>, DTError<R>>,
|
||||||
{
|
{
|
||||||
#[cfg(feature = "debug")]
|
|
||||||
puffin::profile_function!();
|
|
||||||
|
|
||||||
let mut session_damage_tracking = session.lock().unwrap();
|
let mut session_damage_tracking = session.lock().unwrap();
|
||||||
|
|
||||||
let buffer = frame.buffer();
|
let buffer = frame.buffer();
|
||||||
|
|
@ -186,9 +183,6 @@ pub fn render_workspace_to_buffer(
|
||||||
frame: Frame,
|
frame: Frame,
|
||||||
handle: WorkspaceHandle,
|
handle: WorkspaceHandle,
|
||||||
) {
|
) {
|
||||||
#[cfg(feature = "debug")]
|
|
||||||
puffin::profile_function!();
|
|
||||||
|
|
||||||
let shell = state.common.shell.read().unwrap();
|
let shell = state.common.shell.read().unwrap();
|
||||||
let Some(workspace) = shell.workspaces.space_for_handle(&handle) else {
|
let Some(workspace) = shell.workspaces.space_for_handle(&handle) else {
|
||||||
session.stop();
|
session.stop();
|
||||||
|
|
@ -455,9 +449,6 @@ pub fn render_window_to_buffer(
|
||||||
frame: Frame,
|
frame: Frame,
|
||||||
toplevel: &CosmicSurface,
|
toplevel: &CosmicSurface,
|
||||||
) {
|
) {
|
||||||
#[cfg(feature = "debug")]
|
|
||||||
puffin::profile_function!();
|
|
||||||
|
|
||||||
if !toplevel.alive() {
|
if !toplevel.alive() {
|
||||||
session.stop();
|
session.stop();
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue