paperwm / PaperWM

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

Full screen Wayland apps show black screen and top left window corner near center of screen #638

Closed CapSel closed 9 months ago

CapSel commented 1 year ago

Describe the bug I tried to watch a movie in one of streaming services and I pressed F11 in firefox to go to full screen. I saw black screen and window's top left corner was near the middle of screen. Similar behaviour was when I pressed win+shift+f. Same behaviour with kitty (terminal emilator) and other apps.

The other strange behaviour - it's happening only to windows that are last on the right. For second (third...) to last windows maximization shows 1 frame with problem, but then it fixes itself. My Signal app with ozone/wayland enabled is not counted.

To Reproduce Steps to reproduce the behavior:

  1. Put window to maximize as the last window
  2. Press win+shift+f to maximize window to full screen

Expected behavior Full screen windows should not have top left corners near middle of the screen.

I use Arch Linux and newest PaperWM from extensions.gnome.org

jtaala commented 1 year ago

Assuming Gnome 45?

Can you please take a video (even on a phone) or screenshot?

Following your steps, I haven't been able to reproduce this.

jtaala commented 1 year ago

P.S. I'm also on Arch.

jtaala commented 1 year ago
  1. Put window to maximize as the last window

Can you elaborate here what do you mean maximize the window (as in PaperWM maximize horizontally? or just like double-clicking the firefox topbar?).

CapSel commented 1 year ago
  1. Put window to maximize as the last window

Can you elaborate here what do you mean maximize the window (as in PaperWM maximize horizontally? or just like double-clicking the firefox topbar?).

Firefox calls it "full screen" - available from View -> Full Screen.

Screenshot from 2023-10-18 13-49-03

CapSel commented 1 year ago

I think gnome terminology for keyboard shortcut that does same thing is super+shift+f

jtaala commented 1 year ago

Gotcha. Hmm - I'm not seeing this.

To rule out other extensions (if you have any others), can you disable other extensions and see if this is still happening?

This is what I see (let me know if I'm doing something wrong):

https://github.com/paperwm/PaperWM/assets/30424662/6c077cc6-a521-40cc-8d0f-b518a0f08cb6

CapSel commented 1 year ago

I've disabled all extensions and left only PaperWM - still happens.

jtaala commented 1 year ago
  1. Put window to maximize as the last window

Can you elaborate here what do you mean maximize the window (as in PaperWM maximize horizontally? or just like double-clicking the firefox topbar?).

Firefox calls it "full screen" - available from View -> Full Screen.

Screenshot from 2023-10-18 13-49-03

That's definitely weird, almost looks like picture-in-picture or something.

jtaala commented 1 year ago

I've disabled all extensions and left only PaperWM - still happens.

With my video, is that the type of thing that causes your system to do that?

jtaala commented 1 year ago

Are you on a single monitor? and if so, what's resolution are you using?

CapSel commented 1 year ago

Actions on your video are exactly what triggers the problem for me. I'm on single monitor with resolution 2880x1800, scale 150% ("fractional scaling") and I'm using wayland. My video card is amd (from uP ryzen 9 5900hx) + nvidia rtx 3050 Ti. kernel is linux-lts + nvidia-lts Having problems with linux, linux-zen... not related to this issue

CapSel commented 1 year ago

It does not affect games started from lutris - those games are using HD resolution (1920x1080). Does not matter if the game is for linux or windows (native or wine)

jtaala commented 1 year ago

Thanks @CapSel.

HAVEN"T been able to reproduce this.

Will see if any others can reproduce.

jtaala commented 1 year ago

Apologies - updated comment above. It should have read:

Haven't been able to reproduce this.

CapSel commented 1 year ago

Reproduced it on another system:

Please include this information in your bug report on GitHub!
Distribution: Arch Linux
GNOME Shell 45.0
Display server: Wayland
PaperWM branch/tag: release
PaperWM commit: 82db457541a7138c9ad5f4984f871d370f89810f
Enabled extensions:
- thinkpad-battery-threshold@marcosdalvarez.org
- systemd-manager@hardpixel.eu
- appindicatorsupport@rgcjonas.gmail.com
- places-menu@gnome-shell-extensions.gcampax.github.com
- grand-theft-focus@zalckos.github.com
- paperwm@paperwm.github.com
- legacyschemeautoswitcher@joshimukul29.gmail.com
- search-light@icedman.github.com
- drive-menu@gnome-shell-extensions.gcampax.github.com
- windowsNavigator@gnome-shell-extensions.gcampax.github.com
- user-theme@gnome-shell-extensions.gcampax.github.com
- arch-update@RaphaelRochet
- dash-to-dock@micxgx.gmail.com
- GPaste@gnome-shell-extensions.gnome.org

This too has amd video card (no nvidia) but only with HD resolution - so no "fractional scalling". With external monitor. This time it does not matter if it's last window or not - every window switched to full screen replicates the problem.

CapSel commented 1 year ago

I share most of extensions between those 2 computers. Both have amd video card provided by uP. Don't know if there is anything more in common... except the user ;)

How can I debug it?

jtaala commented 1 year ago

Okay, a couple of things to try.

Can you disable all other extensions (other than PaperWM) and then actually restart your computer, login (paperwm only should be enabled at this poitn) and see if you can reproduce? Extensions can run init methods that on first gnome-login that can sometimes clash.

To debug, open a terminal and enter:

journalctl -f /usr/bin/gnome-shell

and try reproduce and see if there are any stacktraces with paperwm referenced (or can just paste the stacktrace here).

It's strange, we've been running PaperWM for several years and I haven't heard of or seen this before. In any case, let me know how you go with the above.

Jay.

jtaala commented 1 year ago

I'll review the full screen code - I can see the small frame for a split second and then the full-screen window shows. Haven't been able to reproduce the issue you're seeing yet but is enough for a code review.

For some reason it appears to be getting stuck at that first frame on your setup.

Will dig into this this weekend.

Cheers,

Jay.

jtaala commented 1 year ago

To debug, open a terminal and enter:

journalctl -f /usr/bin/gnome-shell

and try reproduce and see if there are any stacktraces with paperwm referenced (or can just paste the stacktrace here).

Any stacktraces on your side would be super helpful.

jtaala commented 12 months ago

Question: you haven't by chance changed the animation-time property in PaperWM to 0 have you?

jtaala commented 12 months ago

I think I narrowed it down to animation timing / race condition issue. Let me know if you run the standard animation-time setting in PaperWM or something else.

Could also be some weird animation timing clash with another extension maybe?

jtaala commented 12 months ago

Hey @CapSel,

Could you please give this branch a test to see if it fixes the issue on your end?

git fetch --all
git checkout fix-638-fullscreen-animation-window-resize-bug

and then logout/login.

Thanks!

CapSel commented 12 months ago

Finally - I've found time to test your changes. I haven't changed animation time. I've checked out repo from branch fix-638-fullscreen-animation-window-resize-bug and it works :D gnome-shell does not log any errors on maximizing to full screen... or at all.

IT WORKS !! :D Thank you very much

CapSel commented 12 months ago

ok... there are some not reproducable situations that cause problem to reappear. the only errors that appear in journal for gnome-shell are for appindicator extension.

jtaala commented 12 months ago

Okay. I haven't been able to reproduce this though - could get something like it if I set animation-time to 0 or some silly high number, which I can't reproduce any longer (on this PR branch) - and strangely it only occurred in browsers (brave-browser in my case).

When it reoccurs - is it stuck in that state? (or will un-full-screening and redoing it do that?). Does it occur only in one application (e.g. only in firefox?).

There seems to be something happening on your particular setup (and current extensions etc) that sounds like it's impacting animation stuff? Given I also can't reproduce and no one else has responded.

I'll merge these changes from this branch in as it at least seems to improve the situation.

Without us being able to reproduce, there's no way to isolate and debug it, so once merged will leave this issue active in case others can reproduce and give us more info.

Also, please do the following if you haven't done so already and see if you can reproduce (note disabling other extensions without logging out or restarting won't be sufficient) :

Can you disable all other extensions (other than PaperWM) and then actually restart your computer, login (paperwm only should be enabled at this poitn) and see if you can reproduce? Extensions can run init methods that on first gnome-login that can sometimes clash.

CapSel commented 11 months ago

When it reoccurs - is it stuck in that state? (or will un-full-screening and redoing it do that?). Does it occur only in one application (e.g. only in firefox?).

It occurs with Signal, Firefox, Geary, Kitty, Lutris. Sometimes un-full-screening and redoing fixes problem and sometimes not - I haven't found any specific behaviour that reproduces the problem.

It happens more often when I switch windows using keyboard.

jtaala commented 11 months ago

It occurs with Signal, Firefox, Geary, Kitty, Lutris. Sometimes un-full-screening and redoing fixes problem and sometimes not - I haven't found any specific behaviour that reproduces the problem.

Seems something specific to your setup, I have signal (flatpak), firefox (repo) and can't reproduce this.

Seems others aren't seeing this (or haven't responded) as well (was hoping others are seeing this). If we can't reproduce there's little chance we can isolate and fix (note I can't reproduce not even once, which makes it hard).

You mentioned you're running the nvidia driver in Wayland? Can you provide setup details there? I'm on Endeavour and only have nvidia discrete mode running on X11. But I usually run Wayland in hybrid mode (I have a optimus laptop with a 4080). Never could get discrete mode working in Wayland.

jtaala commented 11 months ago

@Lythenas - have you ever seen this issue?

jtaala commented 11 months ago

@CapSel - check out this comment from @Thesola10 here:

https://github.com/paperwm/PaperWM/issues/646#issuecomment-1783772411

Thesola10 commented 11 months ago

Can repro by running ppy/osu at full res, on fractional scaling, in full screen. For some reason restoring the window from Dash to Panel fixes it, does it also do that for you?

jtaala commented 11 months ago

The fractional scaling thing sounds important here. I'll try play around with that to reproduce this issue.

Thesola10 commented 11 months ago

All windows appear to exhibit this behavior momentarily when switching to full screen, some apps seem to get stuck that way. Unclear what decides that.

Capture vidéo du 2023-10-28 12-39-20.webm

Thesola10 commented 11 months ago

This may be related to an incorrect assumption around "physical size vs framebuffer size" in fractional scaling since the issue doesn't appear when osu! resolution is set to "default" (96dpi-equivalent resolution). Higher resolutions do cause the issue.

CapSel commented 11 months ago

I've noticed that after full-screening and un-full-screening kitty sometimes can't decide on window height - sometimes it looks ok, sometimes it looks like it taller and below top bar. By scrolling windows left / right it shinks, and grows, when it's activated. During that a colorful background behind windows is of constant size.

Lythenas commented 11 months ago

@Lythenas - have you ever seen this issue?

No, I haven't seen this before. But I also don't have any scaling enabled, which seems to be related to this issue.

CapSel commented 11 months ago

I also have this problem on computer that does not use fractional scaling. Main display is 1920x1080 and external display is 3440x1440.

Thesola10 commented 11 months ago

Oh yeah, a window that's last on the right will not fix itself, Firefox included. Can confirm that part of the report.

Thesola10 commented 11 months ago

STATUS REPORT The overview looks funky

image

CapSel commented 11 months ago

You mentioned you're running the nvidia driver in Wayland? Can you provide setup details there? I'm on Endeavour and only have nvidia discrete mode running on X11. But I usually run Wayland in hybrid mode (I have a optimus laptop with a 4080). Never could get discrete mode working in Wayland.

I simply installed nvidia-dkms, added all nvidia modules to /etc/mkinitcpio.conf (MODULES variable), and added nvidia_drm.modeset=1 to grub, overridden 61-gdm.rules (to disable disabling of wayland by gdm), enabled wayland in /etc/gdm/custom.conf... and it kind of just works. No bumblebee. I think this is a "hybrid" mode actually. There is a package nvidia-prime in ArchLinux that has a script prime-run that selects nvidia gpu.

Xorg causes some issues for me.

Is that what you wanted to know?

jtaala commented 11 months ago

Oh yeah, a window that's last on the right will not fix itself, Firefox included. Can confirm that part of the report.

Ah ha! please pull the latest (release) and test. I fixed this one. Yes, I noticed that fullscreening a window that very close to the next monitor (i.e. windows close to the right-side of the left monitor) would fullscreen onto the next monitor (but be invisible)... clicking then the left monitor result in what you see.

See this PR https://github.com/paperwm/PaperWM/pull/650

This has now been merged in gnome-44 and develop/release branches.

jtaala commented 11 months ago

The overview looks funky

funky indeed (but not in a good way....)

jtaala commented 11 months ago

You mentioned you're running the nvidia driver in Wayland? Can you provide setup details there? I'm on Endeavour and only have nvidia discrete mode running on X11. But I usually run Wayland in hybrid mode (I have a optimus laptop with a 4080). Never could get discrete mode working in Wayland.

I simply installed nvidia-dkms, added all nvidia modules to /etc/mkinitcpio.conf (MODULES variable), and added nvidia_drm.modeset=1 to grub, overridden 61-gdm.rules (to disable disabling of wayland by gdm), enabled wayland in /etc/gdm/custom.conf... and it kind of just works. No bumblebee. I think this is a "hybrid" mode actually. There is a package nvidia-prime in ArchLinux that has a script prime-run that selects nvidia gpu.

Xorg causes some issues for me.

Is that what you wanted to know?

Seems similar to me. In any case, def pull the latest release branch. I've also submitted version to EGO but they haven't been looked at yet (will be EGO version 49 for gnome-45).

jtaala commented 11 months ago

Hopefully this helps the situation (although I'm not confident we've pinpointed the precise reproduction mechanism.

But I think the "right-side of left-monitor" window things and scaling? is getting us closer to understanding this better.

jtaala commented 11 months ago

the issue doesn't appear when osu! resolution is set to "default" (96dpi-equivalent resolution). Higher resolutions do cause the issue.

I didn't even know what osu! was... looks like I'm going to have to play it for "debugging" purposes! :-)

CapSel commented 11 months ago

I disabled your extension on my day job laptop and I kind of reproduced the problem. I have a Slack on autostart in gnome and after logging in it looked like in https://github.com/paperwm/PaperWM/issues/638#issuecomment-1783818554 Un-full-screening it and full-screening it again fixed the issue. So it looks like it maybe some upstream bug but I could not find anything similar in gitlab.gnome.org/GNOME

jtaala commented 11 months ago

Oh that's interesting. I was wondering why we hadn't seen this before - goes sound like a gnome 45, wayland, etc. bug.

Maybe PaperWM's previous fullscreen issues caused it to happen more often?

Are you on the latest release (or latest EGO version)? If so, how often does it still happen for you?

Thesola10 commented 11 months ago

Doesn't happen anymore on latest release with Firefox fullscreen, nor kitty. Still happens everytime with osu!, suggesting the osu! trigger for the bug is different (and possibly unrelated with PaperWM)

Haven't tested other SDL2 Wayland apps yet

Thesola10 commented 11 months ago

Okay, quick correction: The issue occurs with osu! when I first launch it with PaperWM active, doesn't occur at launch when PaperWM is inactive, but does occur again if I restore osu! from the overview, regardless of whether PaperWM is active or not. This seems to corroborate the trigger hypothesis.

CapSel commented 11 months ago

It works for me now, however I did not file a bug upstream for this problem yet. Strange... I can't reproduce the problem on any of my computers, with or without the extension.

jtaala commented 11 months ago

Yes, I haven't seen this in a while. @Thesola10 - can you still reproduce this with osu! on the latest PaperWM?