Merge pull request #142 from pop-os/egui-update

Update `smithay-egui` and fix compilation of `debug`
This commit is contained in:
Victoria Brekenfeld 2023-08-08 16:37:07 +02:00 committed by GitHub
commit 8d78328b9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 42 additions and 87 deletions

View file

@ -178,7 +178,7 @@ impl<'a, 'b> RenderElement<GlMultiRenderer<'a, 'b>> for CosmicElement<GlMultiRen
let elem = {
let glow_frame = frame.glow_frame_mut();
RenderElement::<GlowRenderer>::draw(elem, glow_frame, src, dst, damage)
.map_err(|err| MultiError::Render(err))
.map_err(|err| GlMultiError::Render(err))
};
elem
}

View file

@ -8,6 +8,8 @@ use std::{
time::Instant,
};
#[cfg(feature = "debug")]
use crate::debug::{fps_ui, profiler_ui};
use crate::{
config::WorkspaceLayout,
shell::{
@ -29,11 +31,6 @@ use crate::{
},
},
};
#[cfg(feature = "debug")]
use crate::{
debug::{fps_ui, profiler_ui},
utils::prelude::*,
};
use cosmic_protocols::screencopy::v1::server::zcosmic_screencopy_session_v1::FailureReason;
use keyframe::{ease, functions::EaseInOutCubic};

View file

@ -337,6 +337,7 @@ fn format_pointer_focus(focus: Option<PointerFocusTarget>) -> String {
Some(LayerSurface(x)) => format!("LayerSurface {}", 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(PointerFocusTarget::ResizeFork(x)) => format!("Resize Fork {:?}", x.node),
None => format!("None"),
}
}

View file

@ -371,7 +371,7 @@ impl State {
userdata
.get::<SupressedKeys>()
.unwrap()
.add(&handle);
.add(&handle, None);
return FilterResult::Intercept(None);
}
}

View file

@ -569,7 +569,7 @@ impl CosmicMapped {
C: From<CosmicMappedRenderElement<R>>,
{
#[cfg(feature = "debug")]
let mut debug_elements = if let Some(debug) = self.debug.lock().unwrap().as_mut() {
let debug_elements = if let Some(debug) = self.debug.lock().unwrap().as_mut() {
let window = self.active_window();
let window_geo = window.geometry();
let (min_size, max_size, size) =
@ -609,16 +609,16 @@ impl CosmicMapped {
});
ui.horizontal(|ui| {
ui.label("States: ");
if window.is_maximized() {
if window.is_maximized(true) {
ui.label("🗖");
}
if window.is_fullscreen() {
if window.is_fullscreen(true) {
ui.label("");
}
if window.is_activated() {
if window.is_activated(true) {
ui.label("🖱");
}
if window.is_resizing().is_some() {
if window.is_resizing(true).is_some() {
ui.label("");
}
});

View file

@ -681,6 +681,7 @@ impl Common {
}
#[cfg(feature = "debug")]
#[derive(Debug)]
pub struct Egui {
pub active: bool,
pub state: smithay_egui::EguiState,