Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invisible windows cause the tiling to scroll #466

Closed
notpeelz opened this issue Jan 19, 2023 · 5 comments
Closed

invisible windows cause the tiling to scroll #466

notpeelz opened this issue Jan 19, 2023 · 5 comments

Comments

@notpeelz
Copy link

If you have enough windows in your workspace (enough so you can scroll), running wl-copy will cause the workspace to scroll slightly to the right.

How to reproduce:

  1. Open 3 terminal windows
  2. Focus the 2nd one (the one touching the right edge of the screen)
  3. echo test | wl-copy
    That should be enough to trigger the behavior. You should notice the tiling scroll slightly to the right.

I'm assuming this is because wl-clipboard spawns an invisible window (which steals focus) so it can interact with the clipboard.
I've tried forcing it to the scratch layer with a winprop rule matching wl-clipboard. I've also tried adding a call to wl_shell_surface_set_class in wl-clipboard, but that didn't work either.

@notpeelz notpeelz changed the title wl-clipboard causes the tiling to scroll invisible windows cause the tiling to scroll Jan 19, 2023
@jtaala
Copy link
Collaborator

jtaala commented Jan 21, 2023

Thanks @notpeelz, so, I was able to reproduce this but did solve it with a winprop using wm_class = Gnome-shell and scratch_layer = true. It seems wl-copy does create invsible/untracked windows of that class.
Scrap that - still happens (just didn't notice it since the terminal windows wasn't up against the right side...

I've implemented winprops in the settings ui with PR #463 and in the PaperWM-redux fork. Here's the settings I used:

Just a thought, I note that wl-clipboard sets the title. Have you tried setting title in winprop to wl-clipboard?

@jtaala
Copy link
Collaborator

jtaala commented Jan 21, 2023

Okay @notpeelz, this works in my testing: setting winprop title = wl-clipboard and scratch_layer = true.

I've also updated #463 and the PaperWM-redux fork to now have title in the winprops extension settings ui to make it much easier to set winprops title property. Here's the settings I used that worked for me:

image

@notpeelz
Copy link
Author

notpeelz commented Jan 21, 2023

Yup, that seems to work, thanks! Not sure why matching the class didn't work. Maybe (wl_shell_surface_set_class) wasn't the correct Wayland call? Not sure, I don't know much about low-level rendering stuff.

Although, I also have this problem with other invisible windows (e.g Wine/Proton games/programs -- all their windows usually have the same class or have an unreliable title). Do you know if it's possible to match for dimensions in user.js, or would I have to patch the code?

@jtaala
Copy link
Collaborator

jtaala commented Jan 22, 2023

Although, I also have this problem with other invisible windows (e.g Wine/Proton games/programs -- all their windows usually have the same class or have an unreliable title). Do you know if it's possible to match for dimensions in user.js, or would I have to patch the code?

I'm not quite sure what you're trying to do, but user.js is essentially a javascript module with it's init, enable, disable functions run at certain times. So, in theory you could have something there that picks up a signal (e.g the show signal?) that is emitted whenever windows are rendered (and get activated window dimensions)... although that approach will likely be messy etc.

Forking and working on that would likely be easier. If you get somewhere with it, and think it would be useful for others definitely feel to to create a PR.

@jtaala
Copy link
Collaborator

jtaala commented Jan 31, 2023

Closing as original issue was resolved.

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

No branches or pull requests

2 participants