Skip to content

Commit

Permalink
#790: take server latency into account when trying to prevent iconifi…
Browse files Browse the repository at this point in the history
…cation loops: this should give the server enough time to change the window state again before we send the unmap-window packet

git-svn-id: https://xpra.org/svn/Xpra/trunk@8618 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 4, 2015
1 parent 23462e7 commit ff4b2cd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/xpra/client/gtk_base/gtk_client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,15 @@ def window_state_updated(self, widget, event):
def tell_server():
if self._iconified:
self.send("unmap-window", self._id, True)
self.timeout_add(150, tell_server)
#calculate a good delay to prevent races causing minimize/unminimize loops:
delay = 150
spl = list(self._client.server_ping_latency)
if len(spl)>0:
worst = max([x for _,x in spl])
delay += int(1000*worst)
delay = min(1000, delay)
statelog("telling server about iconification with %sms delay", delay)
self.timeout_add(delay, tell_server)
else:
self.process_map_event()
self.after_window_state_updated()
Expand Down

0 comments on commit ff4b2cd

Please sign in to comment.