ch11ng / exwm

Emacs X Window Manager
2.85k stars 134 forks source link

My solution to some focus freezes like mouse staying stuck on click action for example #762

Open StacktraceException opened 4 years ago

StacktraceException commented 4 years ago

When launching with the recommended exec dbus-launch --exit-with-session emacs in xinitrc file, some browser actions reproducibly cause the mouse cursor to stay stuck as pressed down on the clicked button and don't open the clicked link. Keyboard input still works though (can open a new tab with Ctrl-t for example).

When these things happen, then trying to change the buffer for example, is what makes all of the GUI to freeze, that even Ctrl-Alt-Backspace does't work and only SysRq works (which also makes you wait extra 2 minutes for Xserver to begin accepting connections and no — removing its serverauth and related files in /tmp doesn't seem to help, chrome process gets stuck in damned D state (uninterruptible sleep) AFAIR until that 2 minutes passes with smth like X server gives up " after which startx works normally again.

All of this happens too often and especially the 2 minutes waiting part makes EXWM not great for work, but there is an (at least partial) solution below.

Currently some of the things (off the top of my head) which cause such freezes are: ** various things in facebook search like opening a new tab there with scroll wheel clicking on the "people" panel

** zooming in satellite imagery in high detail (and sometimes moving around a bit, takes about 20 seconds) but this occurs also with i3wm for example so this maybe is a separate issue but with GPU driver.

** more that I didn't try to make note of in various sites like youtube for example.

This doesn't happen when Emacs is opened from kitty (also this way seems to start Emacs and kitty a few seconds faster, probably related to that there is less/no repainting visible [resizing]). (exec i3wm and exec herbstluftwm also help with this, maybe it's just related to the dbus part?)

exec kitty --hold --single-instance --start-as=fullscreen is what I use and nohup emacs -mm --no-splash & disown &

(probably could add a script to config.fish to check for a value to determine if it's the first run fish instance and run emacs if that's true).

StacktraceException commented 4 years ago

Ok, so the maps freeze doesn't occur in EXWM anymore when GPU acceleration is disabled (by disabling all flags and command like switches)

Hopefully from now on I can get productive

ch11ng commented 4 years ago

Thanks for the investigation! It seems all the problems here are related to Chrome and disabling GPU acceleration in Chrome helps workaround them. Is that right?

I has been reported by some user that dbus-launch may cause problems. It's totally optional though and you may freely omit that part in your config file.

StacktraceException commented 4 years ago

After some troubleshooting all of GPU acceleration can be force enabled without any problems except for the multiple raster threads part (see chrome://gpu), or GPU rasterization in general, (there doesn't seem to be a way to disable just the multiple raster threads feature, other than maybe compiling without it, I guess. (Yes, the responsivity makes a much better workflow). All is stable now, according to the nouveau feature matrix my GPU isn't finished yet, so still buggy – I assume, I think I should have reported there already.

Sorry for the confusion, these errors started happening at around the same time I started using EXWM. EXWM is awesome, there is nothing better in my opinion.

Yes. dbus-launch causes problems with mouse focus, as written above, though this was also in Firefox AFAIR. Now tested it out and no such thing happens in both browsers for now with the dbus-launch. Keeping it off though just in case. Can test if it just happens with the rasterization on, if it's important. Anyway what are the benefits if any of using dbus-launch?

niedz., 12 lip 2020 o 10:50 Chris Feng notifications@github.com napisał(a):

Thanks for the investigation! It seems all the problems here are related to Chrome and disabling GPU acceleration in Chrome helps workaround them. Is that right?

I has been reported by some user that dbus-launch may cause problems. It's totally optional though and you may freely omit that part in your config file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ch11ng/exwm/issues/762#issuecomment-657193079, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOSWAAAJ7IVERGX3K74GQ6LR3F2NLANCNFSM4OACRG5Q .

ch11ng commented 4 years ago

Anyway what are the benefits if any of using dbus-launch?

I thought it was the standard way to launch a standalone WM and get D-BUS working (by setting environment variables perhaps), which IMO is better than nothing. I've never experienced a single issue without it though.