exwm icon indicating copy to clipboard operation
exwm copied to clipboard

Improve detection of focus changes

Open medranocalvo opened this issue 5 years ago • 4 comments
trafficstars

* 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(?)).

medranocalvo avatar Apr 15 '20 04:04 medranocalvo

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

medranocalvo avatar Apr 18 '20 06:04 medranocalvo

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.

Stebalien avatar May 31 '20 02:05 Stebalien

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

ch11ng avatar Jun 14 '20 09:06 ch11ng

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

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

bendlas avatar Nov 15 '23 17:11 bendlas