Fix building with debug feature
This commit is contained in:
parent
e625a22783
commit
658a88da8c
2 changed files with 27 additions and 34 deletions
48
src/debug.rs
48
src/debug.rs
|
|
@ -3,10 +3,7 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
shell::{
|
shell::focus::target::{KeyboardFocusTarget, PointerFocusTarget},
|
||||||
focus::target::{KeyboardFocusTarget, PointerFocusTarget},
|
|
||||||
CosmicSurface,
|
|
||||||
},
|
|
||||||
state::{Common, Fps},
|
state::{Common, Fps},
|
||||||
};
|
};
|
||||||
use egui::{load::SizedTexture, Color32, Vec2};
|
use egui::{load::SizedTexture, Color32, Vec2};
|
||||||
|
|
@ -19,6 +16,7 @@ use smithay::{
|
||||||
glow::GlowRenderer,
|
glow::GlowRenderer,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
desktop::WindowSurface,
|
||||||
input::keyboard::xkb,
|
input::keyboard::xkb,
|
||||||
reexports::wayland_server::Resource,
|
reexports::wayland_server::Resource,
|
||||||
utils::{Logical, Rectangle},
|
utils::{Logical, Rectangle},
|
||||||
|
|
@ -307,19 +305,17 @@ fn format_pointer_focus(focus: Option<PointerFocusTarget>) -> String {
|
||||||
Some(Element(x)) => match x {
|
Some(Element(x)) => match x {
|
||||||
x if x.is_stack() => format!(
|
x if x.is_stack() => format!(
|
||||||
"Stacked Window {} ({})",
|
"Stacked Window {} ({})",
|
||||||
match x.active_window() {
|
match x.active_window().0.underlying_surface() {
|
||||||
CosmicSurface::Wayland(w) => w.toplevel().wl_surface().id().protocol_id(),
|
WindowSurface::Wayland(t) => t.wl_surface().id().protocol_id(),
|
||||||
CosmicSurface::X11(x) => x.window_id(),
|
WindowSurface::X11(x) => x.window_id(),
|
||||||
_ => unreachable!(),
|
|
||||||
},
|
},
|
||||||
x.active_window().title()
|
x.active_window().title()
|
||||||
),
|
),
|
||||||
x if x.is_window() => format!(
|
x if x.is_window() => format!(
|
||||||
"Window {} ({})",
|
"Window {} ({})",
|
||||||
match x.active_window() {
|
match x.active_window().0.underlying_surface() {
|
||||||
CosmicSurface::Wayland(w) => w.toplevel().wl_surface().id().protocol_id(),
|
WindowSurface::Wayland(t) => t.wl_surface().id().protocol_id(),
|
||||||
CosmicSurface::X11(x) => x.window_id(),
|
WindowSurface::X11(x) => x.window_id(),
|
||||||
_ => unreachable!(),
|
|
||||||
},
|
},
|
||||||
x.active_window().title()
|
x.active_window().title()
|
||||||
),
|
),
|
||||||
|
|
@ -327,10 +323,9 @@ fn format_pointer_focus(focus: Option<PointerFocusTarget>) -> String {
|
||||||
},
|
},
|
||||||
Some(Fullscreen(x)) => format!(
|
Some(Fullscreen(x)) => format!(
|
||||||
"Fullscreen {} ({})",
|
"Fullscreen {} ({})",
|
||||||
match &x {
|
match x.0.underlying_surface() {
|
||||||
CosmicSurface::Wayland(w) => w.toplevel().wl_surface().id().protocol_id(),
|
WindowSurface::Wayland(t) => t.wl_surface().id().protocol_id(),
|
||||||
CosmicSurface::X11(x) => x.window_id(),
|
WindowSurface::X11(x) => x.window_id(),
|
||||||
_ => unreachable!(),
|
|
||||||
},
|
},
|
||||||
x.title()
|
x.title()
|
||||||
),
|
),
|
||||||
|
|
@ -350,19 +345,17 @@ fn format_keyboard_focus(focus: Option<KeyboardFocusTarget>) -> String {
|
||||||
Some(Element(x)) => match x {
|
Some(Element(x)) => match x {
|
||||||
x if x.is_stack() => format!(
|
x if x.is_stack() => format!(
|
||||||
"Stacked Window {} ({})",
|
"Stacked Window {} ({})",
|
||||||
match x.active_window() {
|
match x.active_window().0.underlying_surface() {
|
||||||
CosmicSurface::Wayland(w) => w.toplevel().wl_surface().id().protocol_id(),
|
WindowSurface::Wayland(t) => t.wl_surface().id().protocol_id(),
|
||||||
CosmicSurface::X11(x) => x.window_id(),
|
WindowSurface::X11(x) => x.window_id(),
|
||||||
_ => unreachable!(),
|
|
||||||
},
|
},
|
||||||
x.active_window().title()
|
x.active_window().title()
|
||||||
),
|
),
|
||||||
x if x.is_window() => format!(
|
x if x.is_window() => format!(
|
||||||
"Window {} ({})",
|
"Window {} ({})",
|
||||||
match x.active_window() {
|
match x.active_window().0.underlying_surface() {
|
||||||
CosmicSurface::Wayland(w) => w.toplevel().wl_surface().id().protocol_id(),
|
WindowSurface::Wayland(t) => t.wl_surface().id().protocol_id(),
|
||||||
CosmicSurface::X11(x) => x.window_id(),
|
WindowSurface::X11(x) => x.window_id(),
|
||||||
_ => unreachable!(),
|
|
||||||
},
|
},
|
||||||
x.active_window().title()
|
x.active_window().title()
|
||||||
),
|
),
|
||||||
|
|
@ -370,10 +363,9 @@ fn format_keyboard_focus(focus: Option<KeyboardFocusTarget>) -> String {
|
||||||
},
|
},
|
||||||
Some(Fullscreen(x)) => format!(
|
Some(Fullscreen(x)) => format!(
|
||||||
"Fullscreen {} ({})",
|
"Fullscreen {} ({})",
|
||||||
match &x {
|
match x.0.underlying_surface() {
|
||||||
CosmicSurface::Wayland(w) => w.toplevel().wl_surface().id().protocol_id(),
|
WindowSurface::Wayland(t) => t.wl_surface().id().protocol_id(),
|
||||||
CosmicSurface::X11(x) => x.window_id(),
|
WindowSurface::X11(x) => x.window_id(),
|
||||||
_ => unreachable!(),
|
|
||||||
},
|
},
|
||||||
x.title()
|
x.title()
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ use smithay::{
|
||||||
ImportAll, ImportMem, Renderer,
|
ImportAll, ImportMem, Renderer,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
desktop::{space::SpaceElement, PopupManager, WindowSurfaceType},
|
desktop::{space::SpaceElement, PopupManager, WindowSurface, WindowSurfaceType},
|
||||||
input::{
|
input::{
|
||||||
keyboard::{KeyboardTarget, KeysymHandle, ModifiersState},
|
keyboard::{KeyboardTarget, KeysymHandle, ModifiersState},
|
||||||
pointer::{
|
pointer::{
|
||||||
|
|
@ -641,12 +641,13 @@ impl CosmicMapped {
|
||||||
ui.label("App ID: ");
|
ui.label("App ID: ");
|
||||||
ui.label(window.app_id());
|
ui.label(window.app_id());
|
||||||
});
|
});
|
||||||
ui.label(match window {
|
ui.label(match window.0.underlying_surface() {
|
||||||
CosmicSurface::Wayland(_) => "Protocol: Wayland",
|
WindowSurface::Wayland(_) => "Protocol: Wayland",
|
||||||
CosmicSurface::X11(_) => "Protocol: X11",
|
WindowSurface::X11(_) => "Protocol: X11",
|
||||||
_ => unreachable!(),
|
|
||||||
});
|
});
|
||||||
if let CosmicSurface::X11(ref surf) = window {
|
if let WindowSurface::X11(ref surf) =
|
||||||
|
window.0.underlying_surface()
|
||||||
|
{
|
||||||
let geo = surf.geometry();
|
let geo = surf.geometry();
|
||||||
ui.label(format!(
|
ui.label(format!(
|
||||||
"X11 Geo: {}x{}x{}x{}",
|
"X11 Geo: {}x{}x{}x{}",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue