Skip to content

Commit a1cc8b5

Browse files
committed
remove hacky detection
1 parent c659c5c commit a1cc8b5

2 files changed

Lines changed: 1 addition & 54 deletions

File tree

src/backend/wayland/compositor/window/lifecycle.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,25 @@
11
use smithay::desktop::Window;
2-
use smithay::utils::SERIAL_COUNTER;
32
use smithay::utils::{Logical, Point};
43
use smithay::wayland::shell::xdg::ToplevelSurface;
54

65
use crate::backend::wayland::compositor::WaylandState;
7-
use crate::backend::wayland::compositor::focus::KeyboardFocusTarget;
86
use crate::backend::wayland::compositor::state::WindowIdMarker;
97
use crate::types::WindowId;
108

119
impl WaylandState {
1210
/// Map a new toplevel surface (from XDG shell).
1311
pub fn map_new_toplevel(&mut self, surface: ToplevelSurface) -> WindowId {
14-
let is_overlay = Self::is_unmanaged_wayland_overlay(&surface);
1512
let window = Window::new_wayland_window(surface);
1613
let window_id = self.alloc_window_id();
1714
let _ = window
1815
.user_data()
1916
.get_or_insert_threadsafe(|| WindowIdMarker {
2017
id: window_id,
21-
is_overlay,
18+
is_overlay: false,
2219
});
2320

2421
self.space.map_element(window.clone(), (0, 0), false);
2522
self.window_index.insert(window_id, window.clone());
26-
27-
if is_overlay {
28-
if let Some(keyboard) = self.seat.get_keyboard() {
29-
let serial = SERIAL_COUNTER.next_serial();
30-
keyboard.set_focus(
31-
self,
32-
Some(KeyboardFocusTarget::Window(window.clone())),
33-
serial,
34-
);
35-
}
36-
return window_id;
37-
}
38-
3923
self.ensure_client_for_window(window_id);
4024

4125
if let Some(title) = self.window_title(window_id)

src/backend/wayland/compositor/window/properties.rs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,6 @@ impl WaylandState {
3232
})
3333
}
3434

35-
pub(crate) fn toplevel_title(surface: &ToplevelSurface) -> Option<String> {
36-
let wl_surface = surface.wl_surface();
37-
smithay::wayland::compositor::with_states(&wl_surface, |states| {
38-
states
39-
.data_map
40-
.get::<smithay::wayland::shell::xdg::XdgToplevelSurfaceData>()?
41-
.lock()
42-
.ok()?
43-
.title
44-
.clone()
45-
})
46-
}
47-
4835
/// Get the app_id (desktop file ID) of a window.
4936
pub fn window_app_id(&self, window: WindowId) -> Option<String> {
5037
let element = self.window_index.get(&window)?;
@@ -66,30 +53,6 @@ impl WaylandState {
6653
})
6754
}
6855

69-
pub(crate) fn toplevel_app_id(surface: &ToplevelSurface) -> Option<String> {
70-
let wl_surface = surface.wl_surface();
71-
smithay::wayland::compositor::with_states(&wl_surface, |states| {
72-
states
73-
.data_map
74-
.get::<smithay::wayland::shell::xdg::XdgToplevelSurfaceData>()?
75-
.lock()
76-
.ok()?
77-
.app_id
78-
.clone()
79-
})
80-
}
81-
82-
/// Detect helper toplevels that should stay outside WM client management.
83-
///
84-
/// `wl-clipboard` creates a 1x1 fully transparent `xdg_toplevel` as a
85-
/// focus-acquisition hack when data-control is unavailable. Managing that
86-
/// surface like a normal client causes pointless layout churn.
87-
pub(crate) fn is_unmanaged_wayland_overlay(surface: &ToplevelSurface) -> bool {
88-
let app_id = Self::toplevel_app_id(surface).unwrap_or_default();
89-
let title = Self::toplevel_title(surface).unwrap_or_default();
90-
app_id == "io.github.bugaevc.wl-clipboard" || title == "wl-clipboard"
91-
}
92-
9356
/// Create a foreign toplevel handle for a window.
9457
pub(crate) fn create_foreign_toplevel(&mut self, window: WindowId) {
9558
let title = self.window_title(window).unwrap_or_default();

0 commit comments

Comments
 (0)