Skip to content
Snippets Groups Projects
Commit 94739a89 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

fix: Main: Process window shortcuts when no chat is open

parent 3599cbc0
No related branches found
No related tags found
No related merge requests found
......@@ -363,31 +363,31 @@ def _on_action(self,
action: Gio.SimpleAction,
_param: Optional[GLib.Variant]) -> Optional[int]:
control = self.get_active_control()
if control is None:
action_name = action.get_name()
log.info('Activate action: %s', action_name)
if action_name == 'escape' and self._chat_page.hide_search():
return None
log.info('Activate action: %s, active control: %s',
action.get_name(), control.contact.jid)
action_name = action.get_name()
control = self.get_active_control()
if control is not None:
res = control.delegate_action(action_name)
if res != Gdk.EVENT_PROPAGATE:
return res
res = control.delegate_action(action_name)
if res != Gdk.EVENT_PROPAGATE:
return res
if action_name == 'escape':
if self._chat_page.hide_search():
return None
if action_name == 'escape':
if app.settings.get('escape_key_closes'):
self._chat_page.remove_chat(control.account,
control.contact.jid)
return None
if app.settings.get('escape_key_closes'):
elif action_name == 'close-tab':
self._chat_page.remove_chat(control.account,
control.contact.jid)
return None
elif action_name == 'close-tab':
self._chat_page.remove_chat(control.account, control.contact.jid)
elif action_name == 'switch-next-tab':
if action_name == 'switch-next-tab':
self.select_next_chat(Direction.NEXT)
elif action_name == 'switch-prev-tab':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment