PaperWM icon indicating copy to clipboard operation
PaperWM copied to clipboard

Switch to monitor not working with active scratch layer

Open Strauman opened this issue 5 years ago • 3 comments

Description

Consider two monitors. Mon 1 has a scratch screen open and Mon 2 is active. When using keyboard shortcuts to switch Mon 2 to Mon 1, nothing happens. Moving the mouse between monitors works as expected.

Reproduction steps:

  • Using two monitors. Referring to as Monitor 1 and Monitor 2.
  1. Add at least two tiling windows to Monitor 1 and make one of the windows floating. Keep scratch screen enabled with the floating window.
  2. Open at least one tiled window on Monitor 2.
  3. Use the mouse to select the floating window on the scratch screen in Monitor 1.
  4. When in the floating window of Monitor 1, trigger the appropriate Select neighbouring monitor keyboard shortcut to select Monitor 2. (SuperArrow_key by default). This selects the neighbouring monitor as expected.
  5. When in one of the tiled windows of Monitor 2, trigger the appropriate Select neighbouring monitor keyboard shortcut to select Monitor 1. Nothing appears to be happening.

Technical info

  • Gnome shell 3.28.4
  • On git commit 42a69e6c8b748723fcf06e0c4219b8fc2a40fc04 (Develop branch)
  • Ubuntu 18.04.4 LTS

Strauman avatar May 04 '20 09:05 Strauman

Seems we simply warp the pointer and activate the monitor workspace when switching monitors [1]. Since scratch windows belong to all workspaces no focus change happens.

Note: It's the focus window that determine which monitor is considered active, not mouse pointer [2].

So in some sense it's step 4 that doesn't work. Ie. focus remains at the scratch window in monitor 1.

It's probably best to ensure a window in the target monitor receives focus. (or alternatively make the mouse pointer determine active monitor)

[1] https://github.com/paperwm/PaperWM/blob/1ddad3e845b08711106414c6eecc0c0994869938/tiling.js#L1564

[2] https://github.com/paperwm/PaperWM/blob/1ddad3e845b08711106414c6eecc0c0994869938/scratch.js#L18

olejorgenb avatar May 04 '20 10:05 olejorgenb

So in some sense it's step 4 that doesn't work. Ie. focus remains at the scratch window in monitor 1.

You're right! Didn't catch that. The focus remains at scratch window in monitor 1, but both the status bar and mouse pointer still move over to monitor 2 (as expected).

Moreover, as is probably what you're inferring, if step 4 is replaced by using the mouse to change focus to monitor 2, then step 5 does in fact work. Sorry for not being more thorough in investigating the behaviour.

Strauman avatar May 04 '20 11:05 Strauman

Moreover, as is probably what you're inferring, if step 4 is replaced by using the mouse to change focus to monitor 2, then step 5 does in fact work. Sorry for not being more thorough in investigating the behaviour.

Actually, it doesn't work with the mouse. I made a new issue on this #298.

Strauman avatar May 04 '20 13:05 Strauman