Skip to content

waylandtasksmodel: Implement transient handling on Wayland similar to X

Kai Uwe Broulik requested to merge work/kbroulik/tm-wayland-transient into master

This hides windows with a parent (e.g. confirmation dialogs) from task bar like is done on X, including propagation of "demands attention" to the parent window.

--

@vladz @zamundaaa @davidedmundson @hein

With this I no longer get message boxes and config dialogs shown in task manager, matching behavior in the X session.

Due to a bug in KWin or KWayland, parentWindowChanged isn’t properly emitted for a Task Manager inside plasmashell because there’s two instances of PlasmaWindowManagement, one from the Shell Corona, the other from Task Manager. KWin sends the parent_window signal with the same ID for both instances, which won’t match the ID of the window in the second instance, so parentWindow() is always null here. It works in plasmawindowed, though. Fixed in KWin.

Also, transient handling on KWin Wayland behaves a bit differently than on X:

  • There is no concept of a “modal” dialog on Wayland. On X, a message box will darken the parent and minimizing it will minimize its parent with it. On Wayland I can bring up a message box, minimize it, and then I am stuck with a parent window that doesn’t react to input!
  • Activating a window with a transient child does not activate the child window. It brings both to the front (unminimizing, if necessary) but focus will remain with the activated window (i.e. the main window). This is taken care of explicitly here in requestActivate() but shouldn’t be necessary.
    • Edit: Seems this is actually implemented in Qt in xcb platform in QXcbWindow::relayFocusToModalWindow
  • Minimize geometry also doesn’t seem to propagate to child windows, this is also done explicitly in code here Fixed in KWin.

Edit: There is a Wayland dialog protocol in the works, relevant KWin implementation is kwin!4244 (merged)

Edited by Kai Uwe Broulik

Merge request reports