xmonad-contrib icon indicating copy to clipboard operation
xmonad-contrib copied to clipboard

Window Swallowing error with multi monitor

Open arthurmelton opened this issue 2 years ago • 2 comments

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

  • [X] I've read CONTRIBUTING.md

  • I tested my configuration

    • [X] With xmonad version 0.17.0
    • [X] With xmonad-contrib version 0.17.0

arthurmelton avatar Sep 06 '22 21:09 arthurmelton

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.

arthurmelton avatar Sep 06 '22 21:09 arthurmelton

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.

slotThe avatar Sep 07 '22 06:09 slotThe