-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Some apps freeze when switching between monitors #943
Comments
Thanks for reporting @eljamm. I can't reproduce this with Calibre. Can you please tell me exactly how you're switching monitors? (i.e. are you just moving your mouse to another monitor, or using PaperWM's workspace switching keybinds?). |
Let me know if I'm doing anything different from you in the video below (p.s I have both calibre ebook-viewer and kitty on my right monitor, and am switching to the left monitor with my mouse multiple times): Screencast.from.2024-09-07.15-21-03.mp4Not sure if you can see my mouse cursor, but I'm switching to the left monitor multiple times. P.S. that terminal is kitty with htop running |
It seems that I can reproduce this with all workspace/monitor switching methods including the mouse and the
No, that seems about right. Running the debug script from the repo, I get the following PaperWM.log. Switching to a workspace with no apps results in this message:
But if I open an app, that message doesn't show up anymore when I switch. Aside from this, I also notice the following warnings:
Is there anything more I can do to debug this further, perhaps? Note: I found this issue in the kitty repo where another user was having the same problem using PaperWM. Although it has been suggested that it was a Wayland issue, I'm experiencing this under X11 as well. |
That last one looks interesting but nothing really stands out in those logs. I've never seen this and can't reproduce with either calibre or kitty. I wonder if it's anything to do with a video card? What video card / driver are you using (e.g. nvidia / optimus etc.?). Just trying to think of other things since that might help in reproducing. For calibre and kitty - how were they installed (just checking if anything like flatpak etc. was used). I put a couple of tags up to see if anyone else is seeing this. |
I'm using a laptop with AMD and Nvidia (using PRIME) graphics:
I tried using:
But the problem persists across all these cases. I also tried rolling back my kernel from
I'm using NixOS, so I'm just installing these using Nix. Kitty is installed as a user package here and calibre as a system package here. More information about my system
Thanks, I really appreciate any help. PaperWM has been amazing so far and this is the only issue I'm having with it. |
I kinda found a workaround which is to use the 2024-09-07.16-35-11.mp4Having this option enabled, the affected apps seem to function normally when switching between monitors. However, this isn't perfect as it messes up the visibility between windows. The toggled window also appears in all workspaces in that monitor, which is expected since it's what the option does but it's a bit annoying. Moreover, sometimes the window with this option stutters without being in fullscreen: 2024-09-07.16-49-58.mp4 |
@eljamm, are you able to create a new test user on your system, login to said user, install paperwm and test if you still reproduce this? A new user will be in a clean gnome env. Just trying to rule out anything in your current setup / environment. |
Hey @Thesola10 - iirc, you're also a nixos user(?). Have you seen this type of issue before? |
@jtaala I tried with a new user, but that unfortunately doesn't work. However, that gave me the idea to try booting into a live ISO, which did work both for calibre and kitty.
Since the ISO is running the stable NixOS release, its packages are a few versions behind my system which is on an unstable branch. The user who was having the same issue in the kitty issue above was also running Gnome 46.4 (albeit on EndeavourOS), so I'm suspecting that the issue appeared somewhere between 46.2 and 46.4. I'll try downgrading my Mutter version and try again. |
I downgraded Gnome shell and mutter to 46.2 but the problem still happens on my main configuration, even with the new user. |
Interestingly, I can reproduce the hiding/non-rendering in calibre ebook-viewer but only in X11 - not in wayland. Looking at the info from the live iso you posted - it looks to be running wayland. You mentioned also seeing in wayland, can you confirm that your session is actually wayland (in PaperWM settings, you can see if wayland in the info tab). Re the hiding-page issue in calibre, I suspect that it might be something in mutter (or Calibre itself) for efficiency(?), e.g. if it's on another workspace then stop rendering (kind of like js/browser tabs deferring/sleeping processes when tab is not active). This kind of makes sense in vanilla gnome, since you can't view two workspaces at once (i.e. Gnome has a "one workspace across all monitors" paradigm). PaperWM actually implements a "distinct workspace per monitor" paradigm, so you can actually see multiple workspaces at once (note, this does have it's own issues). |
For reference, here's my info:
|
I actually can't open the info tab in Wayland: But I can confirm that the issue happens inside a Wayland session:
Calibre's behavior is the same, but kitty takes a 3-4 seconds to freeze under Wayland whereas in X11 it just instantly freezes. Also, I think the live ISO only runs in Wayland, so I think I'll have to create a custom ISO to make it run on X11. |
I made two custom ISO, one for NixOS stable (24.05) and the other following my system's unstable branch (24.11). They are configured exactly the same with only Gnome enabled and the apps necessary to reproduce the issue (kitty, calibre and htop).
This is the result of my testing:
Note: The info tab opened normally inside the custom ISO on Wayland, so it might just be something amiss with my system, but it's not that important. |
It might give us a clue as the error or issue though(?). Can you run the following (or the equivalent in nixos):
then open PaperWM preferences and open the info tab (and check the output and post any errors here)? |
Uh... looks like the menu is hidden for some reason and it always comes back after I unhide it: 2024-09-09.16-18-24.mp4The log messages in the video are:
I don't think this is related to the focus issue, though. In that regard, I'm currently bisecting the nixpkgs commit history between the stable and unstable branches in hope of determining the change that introduced this issue. That might take a bit of time, though. git bisect log
|
So I finished bisecting nixpkgs and I found out that updating kitty from v0.34.1 to v0.35.0 was the issue: git bisect log
Reading the changelog, I assume the culprit here is:
This works fine when PaperWM is disabled since windows on both monitors are on the same workspace so they're not suspended as you previously explained. Unfortunately, even after rolling back kitty to 0.34.1, it still didn't work in my system under Wayland, so this might go deeper than that 😓 As such, I don't think this issue can be fixed by PaperWM directly unless there is a way to disable window-suspending at runtime. For the meantime, I'll just use another terminal on my second monitor and use the workaround for calibre. That said, I'm still quite confused why X11 is having this issue as well ... |
I was looking into this one, appears to be this property: https://docs.gtk.org/gtk4/method.Window.is_suspended.html
Yes, It's essentially an assumption that doesn't quite work on PaperWM (since we implement one-workspace-per monitor). It's gtk though, and couldn't (as yet) find a js binding (i.e. to override / monkey-patch) this one. |
Thank you so much for your support and patience thus far. I'm quite happy with the improvement in workflow that PaperWM brings me that I don't mind working around the issue if it's happening with just 2 programs.
Feel free to close this issue if you think it can't be done or if it might be too difficult to implement. |
A small update on this. I was able to fix the issue for Calibre on Wayland by using the PS: the issue still persists with kitty. |
Another update. I don't know why kitty |
I tried reaching out to Kitty's developer with no luck: kovidgoyal/kitty#7992 (comment) |
I ended up patching kitty and building from source to disable the Here's the patch file for anyone interested:
I don't expect it to break anytime soon since so little code was changed. |
Describe the bug
In a multi-monitor setup, some apps freeze when switching to another monitor.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The apps continue to work and render correctly after switching to another monitor.
Screenshots
2024-09-06.11-23-26.mp4
System information:
Additional context
Right now, I'm only experiencing this with kitty terminal and calibre, but other apps might be affected.
Also, this happens both in X11 and Wayland.
The text was updated successfully, but these errors were encountered: