You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MRU actions `focus-window-mru-previous` and `focus-window-mru-next`
are used to navigate windows in most-recently-used or
least-recently-used order.
Whenever a window is focused, it records a timestamp that be used to
sort windows in MRU order. This timestamp is not updated immediately,
but only after a small delay (lock-in period) to ensure that the
focus wasn't transfered to another window in the meantime. This
strategy avoids upsetting the MRU order with focus events generated by
intermediate windows when moving between two non contiguous windows.
The lock-in delay can be configured using the `focus-lockin-ms`
configuration argument.
Calling either of the `focus-window-mru` actions starts an MRU window
traversal sequence if one isn't already in progress. When a sequence is
in progress, focus timestamps are no longer updated.
A traversal sequence ends when:
- either the `Mod` key is released, the focus then stays on the chosen
window and its timestamp is immediately refreshed,
- or if the `Escape` key is pressed, the focus returns to the window
that initially had the focus when the sequence was started.
Rename WindowMRU fields
Improve window close handling during MRU traversal
When the focused window is closed during an MRU traversal, it moves
to the previous window in MRU order instead of the default behavior.
Removed dbg! calls
Merge remote-tracking branch 'upstream/main' into window-mru
Hardcode Alt-Tab/Alt-shift-Tab for MRU window nav
- Add a `PRESET_BINDINGS` containing MRU navigation actions.
`PRESET_BINDINGS` are overridden by user configuration so these remain
available if the user needs them for another purpose
- Releasing the `Alt` key ends any in-progress MRU window traversal
Remove `focus-window-mru` actions from config
These actions are configured in presets but no longer available
for the bindings section of the configuration
Cancel MRU traversal with Alt-Esc
Had been forgotten in prior commit and was using `Mod` instead of `Alt`
Rephrase some comments
Fix Alt-Esc not cancelling window-mru
Merge remote-tracking branch 'upstream/main' into window-mru
Lock-in focus immediately on user interaction
As per suggestion by @bbb651, focus is locked-in immediately if a window
is interacted with, ie. receives key events or pointer clicks.
This change is also an opportunity to make the lockin timer less aggresive.
Merge remote-tracking branch 'upstream/main' into window-mru
Simplify WindowMRU::new
Now that there is a more general Niri::lockin_focus method, leverage
it in WindowMRU.
Replace Duration with Instant in WindowMRU timestamp
Merge remote-tracking branch 'upstream/main' into window-mru
Address PR comments - partial
- Swapped meaning of next and previous for MRU traversal
- Fixed comment that still referred to `Mod` as leader key for MRU traversal
instead of `Alt`
- Fixed doc comments that were missing a period
- Stop using BinaryHeap in `WindowMRU::new()`
- Replaced `WindowMRU::mru_with()` method with a simpler `advance()`
- Simplified `Alt` key release handling code in `State::on_keyboard()`
Simplify early-mru-commit logic
No longer perform the mru-commit/lockin_focus in the next event loop callback.
Instead it is handled directly when it is determined that an event (pointer
or kbd) is forwarded to the active window.
Handle PR comments
- `focus_lockin` variables and configuration item renamed to `mru_commit`.
- added the Esc key to `suppressed_keys` if it was used to cancel an MRU
traversal.
- removed `WindowMRU::mru_next` and `WindowMRU::mru_previous` methods
as they didn't really provide more than the generic `WindowMRU::advance`
method.
- removed obsolete `Niri::event_forwarded_to_focused_client` boolean
- added calls to `mru_commit()` (formerly `focus_lockin`) in:
- `State::on_pointer_axis()`
- `State::on_tablet_tool_axis()`
- `State::on_tablet_tool_tip()`
- `State::on_tablet_tool_proximity()`
- `State::on_tablet_tool_button()`
- `State::on_gesture_swipe_begin()`
- `State::on_gesture_pinch_begin()`
- `State::on_gesture_hold_begin()`
- `State::on_touch_down()`
Merge remote-tracking branch 'upstream/main' into window-mru
Merge remote-tracking branch 'upstream/main' into window-mru
0 commit comments