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

Improve detection of focus changes #737

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

medranocalvo
Copy link
Collaborator

* exwm-input.el: (exwm-input--on-buffer-list-update): Keep track
of last selected window and buffer, update focus only when those
change.
(exwm-input--update-focus-defer): Add commentary.
(exwm-input--buffer-list-update-last-selected-window)
(exwm-input--buffer-list-update-last-selected-buffer): Add
variables.
(exwm-input--skip-buffer-list-update): Remove variable.
(exwm-input--on-buffer-list-update): Stop checking
`exwm-input--skip-buffer-list-update'; it's no longer needed when
keeping track selected window and buffer.

* exwm-manage.el (exwm-manage--manage-window): Remove binding of
`exwm-input--skip-buffer-list-update'.

This should limit substantially the number of on-buffer-list-updates we react to. Especially, it should ignore all with-temp-buffer, as those don't select a different window (note that we use (window-buffer (selected-window)) and not (current-buffer)).

A further improvement could be to check that the selected window belongs to an EXWM-managed frame (workspace, floating, minibuffer(?)).

QiangF and others added 2 commits April 18, 2020 00:00
	* exwm-input.el: (exwm-input--on-buffer-list-update): Keep track
	of last selected window and buffer, update focus only when any
	of those changes.
	(exwm-input--update-focus-defer): Add commentary.
	(exwm-input--update-focus-window-buffer): Add
	variable.

Copyright-paperwork-exempt: yes
Co-Author: Adrián Medraño Calvo <[email protected]>
	* exwm-input.el: (exwm-input--on-buffer-list-update): Stop
	checking `exwm-input--skip-buffer-list-update'; it's no longer
	needed now that we keep track of the last selected window and
	buffer.
	(exwm-input--skip-buffer-list-update): Remove variable.

	* exwm-manage.el (exwm-manage--manage-window): Remove binding of
	`exwm-input--skip-buffer-list-update'.
@medranocalvo medranocalvo force-pushed the update-focus-upon-selected-window-only branch from ad8cddc to 2402413 Compare April 18, 2020 06:30
@medranocalvo
Copy link
Collaborator Author

Some notes: as mentioned in #706, I attributed part of the changes to @QiangF. Mentioned there as well, this should fix #705.

@Stebalien
Copy link
Contributor

Stebalien commented May 31, 2020

I haven't rigorously tested it but, while exwm-layout--refresh-workspace is still noticeable, this patch appears to help.

edit: Ah, wait, was I'm not sure if this was even supposed to help with #756.

@ch11ng
Copy link
Owner

ch11ng commented Jun 14, 2020

@medranocalvo Do you think we should merge it anyway? It should help alleviate other problems at least.

tvlbot pushed a commit to tvlfyi/kit that referenced this pull request Jun 5, 2023
This is almost one year of changes to EXWM. Note that it undoes our
port of ch11ng/exwm#737

That PR hasn't seen any movement in three years, so it might not be
that relevant anymore. Other stuff has been mainlined in the meantime.

Change-Id: I0845ff8a28a5bb1553855f6d6f0ceeaedcf0809e
@bendlas
Copy link

bendlas commented Nov 15, 2023

Applied this to my fork https://github.com/bendlas/exwm

I think it fixes the focus problems, I've been having ..

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

Successfully merging this pull request may close these issues.

5 participants