xmonad / xmonad-contrib

Contributed modules for xmonad
https://xmonad.org
BSD 3-Clause "New" or "Revised" License
584 stars 274 forks source link

Window Swallowing error with multi monitor #752

Open arthurmelton opened 2 years ago

arthurmelton commented 2 years ago

Problem Description

If you turn on window swallowing but before the window pops up you focus a new monitor then it does not hide the terminal.

Steps to Reproduce

run sleep 5; mpv https://www.w3schools.com/html/mov_bbb.mp4
focus a window on a different monitor (focusing a different monitor)
wait for the window to popup and see that the terminal has not minimized.

Configuration File

(its just the normal windowswallowing from the site)

Checklist

arthurmelton commented 2 years ago

It also seams that if I swallow a window that once the window closes (like one mpv finishes a video) and I am focused on a new monitor that it will add the terminal to that monitor and not the one it originated from.

slotThe commented 2 years ago

This is one of the big assumptions of X.H.WindowSwallowing:

  -- For a window to be opened from within another window, that other window
  -- must be focused. Thus the parent window that would be swallowed has to be
  -- the currently focused window.

The implementation would probably have to get a bit more complicated if we wanted to support this use-case (even just focusing on visible workspaces and ignoring hidden ones). We would somehow list all parents of the child window and then check whether the condition applies for any one of them instead of just using the currently focused window. The stack restoring logic would probably also have to become a bit more extensive.

I'll mark it as a feature request.