diff --git a/src/xpra/server/mixins/input_server.py b/src/xpra/server/mixins/input_server.py index ab404ecee3..558a526a97 100644 --- a/src/xpra/server/mixins/input_server.py +++ b/src/xpra/server/mixins/input_server.py @@ -48,6 +48,9 @@ def cleanup(self): self.clear_keys_pressed() self.keyboard_config = None + def reset_focus(self): + self.clear_keys_pressed() + def reset_state(self): self.clear_keys_pressed() diff --git a/src/xpra/server/mixins/stub_server_mixin.py b/src/xpra/server/mixins/stub_server_mixin.py index 0335e35892..0f8031d50d 100644 --- a/src/xpra/server/mixins/stub_server_mixin.py +++ b/src/xpra/server/mixins/stub_server_mixin.py @@ -23,6 +23,13 @@ def init(self, _opts): def init_state(self): pass + + """ + Called when we reset the focus. + """ + def reset_focus(self): + pass + """ Called when the last client has exited, so we can reset things to their original state. diff --git a/src/xpra/server/server_base.py b/src/xpra/server/server_base.py index 8a83e70803..cbb3a29ee7 100644 --- a/src/xpra/server/server_base.py +++ b/src/xpra/server/server_base.py @@ -813,6 +813,12 @@ def set_ui_driver(self, source): c.set_session_driver(self, source) + def reset_focus(self): + for c in SERVER_BASES: + if c!=ServerCore: + c.reset_focus(self) + + def get_all_protocols(self): return list(self._potential_protocols) + list(self._server_sources.keys()) diff --git a/src/xpra/x11/server.py b/src/xpra/x11/server.py index 614143e1ea..78e4d66aea 100644 --- a/src/xpra/x11/server.py +++ b/src/xpra/x11/server.py @@ -660,7 +660,8 @@ def reset_focus(): if self._wm: toplevel = self._wm.get_property("toplevel") focuslog("reset_focus() %s / %s had focus (toplevel=%s)", self._has_focus, had_focus, toplevel) - self.clear_keys_pressed() + #this will call clear_keys_pressed() if the server is an InputServer: + self.reset_focus() # FIXME: kind of a hack: self._has_focus = 0 #toplevel may be None during cleanup!