paperwm / PaperWM

Tiled scrollable window management for Gnome Shell
GNU General Public License v3.0
2.96k stars 125 forks source link

Mixed-scale multi-monitor handles off-screen windows weirdly without 'scale-monitor-framebuffer' #261

Open cg505 opened 4 years ago

cg505 commented 4 years ago

Sorry for the tongue twister title.

I have one 4k screen and one FHD screen, and I'm running wayland (so the 4k is at 200% scale and the FHD screen at 100%). Generally, this works surprisingly well.

However, when a window on the 100% screen is pushed off the screen in the direction of the 200% screen, it seems to notice that based on the position of the window, it should be scaled to 200% (even though we don't really want this to happen). This can cause a lot of weirdness, for instance the upscaled window being visible behind the windows that are currently on screen, between the gaps. Also, when you bring the window back on screen, there's some awkward flickering as it changes back to 100% scale. Often this process of changing back and forth between scales also changes the windows size for whatever reason.

If we can just fix scaling on a workspace level based on which monitor the workspace is being shown on, that would be great. Unfortunately I have pretty much no clue what that would look like in terms of code.

90 seems relevant but I'm not sure how?

hedning commented 4 years ago

Yeah, this is hardly ideal. On wayland, turning on the scale-monitor-framebuffer experimental feature works. Though I IIRC correctly it doesn't work in X11. You can do that like this:

dconf write /org/gnome/mutter/experimental-features "['scale-monitor-framebuffer']"

Getting this to work without the above feature probably isn't doable as an extension (though I haven't dug that deep tbh). As far as I know gnome-shell/mutter doesn't expose the necessary functionality to control the window scaling from javascript.

A possible workaround is making sure the windows aren't moved into monitors with different scales. But that means replacing them with non-interactive clones when they're more than halfway into the other monitor (this is already done on when windows have than 75px inside a montitor as mutter refuses to move them further). So hardly ideal, but would be somewhat better I guess.

Now I believe gnome-shell/mutter intends for scale-monitor-framebuffer to be the default in the future. But we could probably add the scale-monitor-framebuffer setting to the recommended settings so people are less likely to run into this issue.

cg505 commented 4 years ago

Thanks! FWIW, even with scale-monitor-framebuffer, Firefox on Wayland does not seem happy. The GTK apps seem to have things figured out though.

hedning commented 4 years ago

Right, firefox-wayland does have some weird issues all over the board, but there's quite a lot of work going on in upsteram, so will hopefully be fixed there.

Didn't find any open bugs on the problem in the wayland meta bug so might be worth opening one.