Skip to content

foreign-toplevel: announce a toplevel to taskbars with its first buffer - #241

Open
sachahjkl wants to merge 1 commit into
bea4dev:mainfrom
sachahjkl:fix/foreign-toplevel-on-first-buffer
Open

sachahjkl wants to merge 1 commit into
bea4dev:mainfrom
sachahjkl:fix/foreign-toplevel-on-first-buffer

Conversation

@sachahjkl

Copy link
Copy Markdown
Contributor

Problem

ShojiWM creates the foreign-toplevel handles of an xdg toplevel (ext-foreign-toplevel-list, wlr-foreign-toplevel-management, the Plasma window list) in new_toplevel, when the toplevel role is created. Some programs create their toplevel and never show it: for example, a program started hidden in the notification area. A taskbar then shows a button for a window that nobody can see, and clicking it does nothing visible.

Fix

  • handlers/xdg_shell.rs: new_toplevel no longer calls install_foreign_toplevel.
  • handlers/compositor.rs: the commit handler calls install_foreign_toplevel when the toplevel's surface has a buffer. install_foreign_toplevel is idempotent, so each commit of a shown toplevel can call it. The call comes before the existing sync_foreign_toplevel, so title and app_id updates keep working as before.

A toplevel that never attaches a buffer gets no handle. A toplevel that attaches one gets its handles on that commit.

Tests

No test is added.

cargo test --workspace passes, except two tests that also fail on upstream main in our environment: evaluator::tests::embedded_runtime_ipc_does_not_leak_fds_across_reloads and input_method_keyboard_grab_gets_the_keymap_of_the_keys_it_is_sent.

This change has been running daily in the author's own session (a Windows-7-like desktop on ShojiWM).

ShojiWM made the foreign-toplevel handles (ext-foreign-toplevel-list,
wlr-foreign-toplevel-management, the Plasma window list) when a
toplevel's role was made. A program that makes its window and never
shows it, such as one started hidden in the notification area, then had
a taskbar button for a window nobody could see. The handles now come
with the toplevel's first buffer, in the commit handler; the install is
idempotent, so each commit of a shown toplevel can ask.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant