Skip to content
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

Focus Retention when switching to (non-EXWM) buffers #4

Open
moritzschaefer opened this issue Jan 20, 2024 · 6 comments
Open

Focus Retention when switching to (non-EXWM) buffers #4

moritzschaefer opened this issue Jan 20, 2024 · 6 comments

Comments

@moritzschaefer
Copy link

When switching to another window (usually on a different workspace) with an emacs (not EXWM/X) buffer, it happens (50% of cases) that the 'focus' remains on the last window.

This is visible from the cursor color in switched-to window-buffer (a transparent box
image)

rather than the full-color active-cursor cursor
image

More importantly, when in this inactive state, it happens that typing on the keyboard, leads to input-actions on the previous buffer/window (no matter whether it is an EXWM/X buffer or an emacs buffer)! In consequence, the active workspace automatically "switches back" showing the previously active window/workspace/buffer.

Any ideas on how to debug this?

PS 1: For a long time, I suspected that this is the same error as described in #759, but it must be different, since it also happens when switching between emacs-buffers (although less often)

PS 2: Following old #942 I am opening this in this new repo. A big thank you to the maintainer(s) for moving this project forward!

@minad
Copy link
Member

minad commented Jan 20, 2024

I also stumble over over focus issues from time to time (in general, maybe not specifically this one). Fixing focus issues has a high priority and I hope that we will make progress there soon. In general it is helpful if you provide a minimal recipe (a minimal Emacs configuration), and figure out precise reproduction steps. As you wrote, the issue only happens in 50% of the cases, so the behavior is likely timing dependent and this makes it a little harder to debug. Maybe @Stebalien has some specific debugging suggestions?

@nagy
Copy link

nagy commented Jan 20, 2024

I have had this exact same issue and my solution was to update libX11 to 1.8.4 as I documented here ch11ng/exwm#889 (comment) . There are other suggested fixes in that thread.

@moritzschaefer
Copy link
Author

moritzschaefer commented Jan 20, 2024

Thank you so much for pointing me there. I read through the issues, but didn't recognize that issue as mine while skimming over it. Closing here in favor of the other one

@ArneBab
Copy link

ArneBab commented Jan 14, 2025

I also experience this from time to time. For months I suspected that it was tied to mu4e, but just now it is happening without mu4e and between two Emacs buffers (doc-view mode and org-mode). My libX11 is on version 1.8.7.

@Stebalien
Copy link
Contributor

@ArneBab can you try setting x-no-window-manager to t? I've found not setting this can cause some focus issues, but I've only seen them when switching between X and Emacs windows.

(note: this is now set to t on master, but that hasn't been released yet)

@ArneBab
Copy link

ArneBab commented Jan 14, 2025

I set it now — will report whether the issue repeats in the next days. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants