paperwm / PaperWM

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

Infinite Recursion in addWindow position-change #916

Open MinusGix opened 3 months ago

MinusGix commented 3 months ago

Describe the bug Seems to be the same as #769
Sometimes gnome-shell begins to have high cpu usage which causes lag, usually after a few days online. I've checked journalctl before and not seen these errors previously, but I've started observing them so probably should report.

ul 30 12:47:40 minus-pc gnome-shell[1585]: JS ERROR: too much recursion
                                            addWindow/<@file:///home/minus/.local/share/gnome-shell/extensions/paperwm@paperwm.github.com/tiling.js:956:19
                                            addWindow/<@file:///home/minus/.local/share/gnome-shell/extensions/paperwm@paperwm.github.com/tiling.js:956:19
                                            addWindow/<@file:///home/minus/.local/share/gnome-shell/extensions/paperwm@paperwm.github.com/tiling.js:956:19
...

Moving mouse between my two monitors does tend to produce a burst of errors.

To Reproduce Unsure.

System information: (Via source code)

Distribution: Manjaro Linux
GNOME Shell 46.3.1
Display server: Wayland
PaperWM branch/tag: release
PaperWM commit: 79e7dbb8e8341674f2707a23fbf77251d8361956
Enabled extensions:
- paperwm@paperwm.github.com
- just-perfection-desktop@just-perfection
- dash-to-dock@micxgx.gmail.com
- gnome-ui-tune@itstime.tech
- legacyschemeautoswitcher@joshimukul29.gmail.com
- user-theme@gnome-shell-extensions.gcampax.github.com
- x11gestures@joseexposito.github.io

Additional context I'll try updating to latest PaperWM since I'm on 46.12.1 or so, though I'd be surprised if it fixes the issue since a glance at releases I didn't see commits that would have affected this.

jtaala commented 3 months ago

Thanks for reporting @MinusGix.

This is likely caused for a misbehaving app with a stubborn frame-rect or a position that keeps changing rapidly (for example could be related to an app that doesn't respond well to PaperWM's resizing).

Anyways, we could beef up the recursive calling guard with a max number of attempts.

Next time this happens, have a look at what apps are currently running that might be causing this (e.g. Godot is known to have some issues re focusing/resizing that affects tiling wm's etc.).