[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: We should decouple focus and frame switching
From: |
Stefan Monnier |
Subject: |
Re: We should decouple focus and frame switching |
Date: |
Mon, 11 Jun 2018 11:17:16 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> I don't even think we should have separate focus-in and focus-out hooks.
> We should just have one extension point, some kind focus-change-function.
Sounds fair, tho I think this would lose a bit (literally) of
information, so maybe we could call that focus-change-function with
a parameter indicating whether the change is one which increases the
number of frames-with-focus or one which decreases it, since AFAIK we
would have that information when we'd run the hook.
> that lets a package ask Emacs, "To the best of your current knowledge,
> does FRAME have input focus?" and not just rely on state change
> notifications.
Maybe rather than frame-focused-p we should provide a frames-with-focus
function which directly returns the list of frames with focus.
Or a function terminal-frame-focus which returns the terminal's frame
that has focus (or nil), under the assumption that there can only be one
frame with focus in a given terminal. So instead of looping through
`frame-list`, the Elisp code could loop through `terminal-list`.
It's probably not terribly important, but I often have O(100) frames on
my sole terminal, so the difference is not completely negligible.
Stefan
Re: We should decouple focus and frame switching, Eli Zaretskii, 2018/06/10