Skip to content

Commit

Permalink
only use synthetic unfocus events when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed May 21, 2023
1 parent e2dfae9 commit 608b600
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xpra/client/gtk_base/gtk_client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,8 @@ def destroy(self): #pylint: disable=method-hidden
self.on_realize_cb = {}
ClientWindowBase.destroy(self)
gtk.Window.destroy(self)
self._unfocus()
if self._client.has_focus(self._id):
self._unfocus()
self.destroy = self.noop_destroy


Expand Down
3 changes: 3 additions & 0 deletions xpra/client/mixins/window_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,9 @@ def send_focus(self, wid):
focuslog("send_focus(%s)", wid)
self.send("focus", wid, self.get_current_modifiers())

def has_focus(self, wid):
return self._focused and self._focused==wid

def update_focus(self, wid, gotit):
focuslog("update_focus(%s, %s) focused=%s, grabbed=%s", wid, gotit, self._focused, self._window_with_grab)
if gotit:
Expand Down

0 comments on commit 608b600

Please sign in to comment.