Skip to content

Commit

Permalink
#589: avoid races when sending focus changes: delay sending the "lost…
Browse files Browse the repository at this point in the history
… focus" (focus=0) so that a new window can gain focus, which allows us to avoid doing a "reset_focus" on the server side

git-svn-id: https://xpra.org/svn/Xpra/trunk@6688 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jun 9, 2014
1 parent 3dde489 commit ec8ae5f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,13 @@ def update_focus(self, wid, gotit):
if self.keyboard_helper:
self.keyboard_helper.clear_repeat()
if self._focused:
self.send_focus(0)
#send the lost-focus via a timer and re-check it
#(this allows a new window to gain focus without having to do a reset_focus)
def send_lost_focus():
#check that a new window has not gained focus since:
if self._focused is None:
self.send_focus(0)
self.timeout_add(20, send_lost_focus)
self._focused = None

def do_force_ungrab(self, wid):
Expand Down

0 comments on commit ec8ae5f

Please sign in to comment.