Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/shojiwm_lib/src/handlers/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,18 @@ impl CompositorHandler for ShojiWM {
window.on_commit();
// Before the snapshot below, which derives the window position from the location.
self.keep_client_origin_across_geometry_change(&window);
// A toplevel is announced on the foreign-toplevel protocols once it has a buffer,
// not when its role is made: one that never shows anything (started hidden) is no
// window for a taskbar. Idempotent, so every commit of a shown window can ask.
if let Some(toplevel) = window.toplevel()
&& smithay::backend::renderer::utils::with_renderer_surface_state(
toplevel.wl_surface(),
|state| state.buffer().is_some(),
)
.unwrap_or(false)
{
self.install_foreign_toplevel(&window);
}
// Title / app_id may have changed via xdg_toplevel set_title /
// set_app_id between commits. sync_foreign_toplevel short-circuits
// when nothing changed so this is cheap.
Expand Down
7 changes: 3 additions & 4 deletions src/shojiwm_lib/src/handlers/xdg_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,9 @@ impl XdgShellHandler for ShojiWM {
self.space
.map_element(window.clone(), initial_location, false);
self.ensure_wayland_window_decoration_policy(&wl_surface);
// Announce the new toplevel on ext-foreign-toplevel-list-v1 so shells
// and the portal picker can see it. Has to happen after map so the
// initial title/app_id reads from xdg state succeed.
self.install_foreign_toplevel(&window);
// The foreign-toplevel handles come with the first buffer (the commit handler): a
// toplevel that never shows anything, such as a program started hidden in the
// notification area, is no window for a taskbar.
if uses_xwayland_refresh_override {
self.update_xwayland_refresh_override_for_window(&window, "xdg-toplevel-map");
}
Expand Down