macOS: Fix kitten @ select-window leaving the keyboard in a partially functional state
Fixes #7074
This commit is contained in:
parent
cafd5a7471
commit
5a2ee2f9a3
4 changed files with 11 additions and 2 deletions
|
|
@ -52,6 +52,8 @@ Detailed list of changes
|
|||
|
||||
- Fix a single key mapping not overriding a previously defined multi-key mapping
|
||||
|
||||
- macOS: Fix :code:`kitten @ select-window` leaving the keyboard in a partially functional state (:iss:`7074`)
|
||||
|
||||
0.32.1 [2024-01-26]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
|||
|
|
@ -295,7 +295,6 @@ def clear_global_state(self) -> 'Boss':
|
|||
set_os_window_title(self.os_window_id, '')
|
||||
boss = get_boss()
|
||||
redirect_mouse_handling(False)
|
||||
boss.mappings.clear_keyboard_modes()
|
||||
for wid in self.window_ids:
|
||||
w = boss.window_id_map.get(wid)
|
||||
if w is not None:
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ def update_keymap(self, global_shortcuts:Optional[Dict[str, SingleKey]] = None)
|
|||
|
||||
def clear_keyboard_modes(self) -> None:
|
||||
self.keyboard_mode_stack = []
|
||||
self.set_ignore_os_keyboard_processing(False)
|
||||
|
||||
def pop_keyboard_mode(self) -> bool:
|
||||
passthrough = True
|
||||
|
|
|
|||
|
|
@ -527,6 +527,7 @@ def __init__(self, *lines, active_window = Window()):
|
|||
bad_lines = []
|
||||
self.options = load_config(overrides=lines, accumulate_bad_lines=bad_lines)
|
||||
af(bad_lines)
|
||||
self.ignore_os_keyboard_processing = False
|
||||
super().__init__()
|
||||
|
||||
def get_active_window(self):
|
||||
|
|
@ -555,7 +556,7 @@ def combine(self, action_definition: str) -> bool:
|
|||
return bool(action_definition)
|
||||
|
||||
def set_ignore_os_keyboard_processing(self, on: bool) -> None:
|
||||
pass
|
||||
self.ignore_os_keyboard_processing = on
|
||||
|
||||
def set_cocoa_global_shortcuts(self, opts):
|
||||
return {}
|
||||
|
|
@ -640,3 +641,9 @@ def __call__(self, *keys: str):
|
|||
self.ae(tm.actions, ['neighboring_window left'])
|
||||
self.ae(tm('x'), [True])
|
||||
af(tm.keyboard_mode_stack)
|
||||
|
||||
# modal mapping with --on-action=end must restore OS keyboard processing
|
||||
tm = TM('map --new-mode mw --on-action end m', 'map --mode mw a new_window')
|
||||
self.ae(tm('m', 'a'), [True, True])
|
||||
self.ae(tm.actions, ['push_keyboard_mode mw', 'new_window'])
|
||||
af(tm.ignore_os_keyboard_processing)
|
||||
|
|
|
|||
Loading…
Reference in a new issue