Skip to content

Commit 10cd536

Browse files
committed
when we get a decoding error, schedule a full window refresh (remove the need for the window in cancel_damage: we don't need to access the UI object here or check that it is even "sendable"
git-svn-id: https://xpra.org/svn/Xpra/trunk@8248 3bb7dfac-3a0b-4e04-842a-767bc560f471
1 parent 605162d commit 10cd536

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/xpra/server/server_base.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -1680,17 +1680,22 @@ def _process_damage_sequence(self, proto, packet):
16801680
ss = self._server_sources.get(proto)
16811681
if ss:
16821682
ss.client_ack_damage(packet_sequence, wid, width, height, decode_time)
1683+
if decode_time<0:
1684+
#an error occurred, try to refresh:
1685+
ss.cancel_damage(wid)
1686+
def refresh():
1687+
win = self._id_to_window.get(wid)
1688+
ss = self._server_sources.get(proto)
1689+
if ss and win:
1690+
ss.refresh(wid, win, {})
1691+
self.idle_add(refresh)
16831692

16841693

16851694
def _damage(self, window, x, y, width, height, options=None):
16861695
wid = self._window_to_id[window]
16871696
for ss in self._server_sources.values():
16881697
ss.damage(wid, window, x, y, width, height, options)
16891698

1690-
def _cancel_damage(self, wid, window):
1691-
for ss in self._server_sources.values():
1692-
ss.cancel_damage(wid, window)
1693-
16941699

16951700
def _process_buffer_refresh(self, proto, packet):
16961701
""" can be used for requesting a refresh, or tuning batch config, or both """

src/xpra/server/source.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1383,13 +1383,11 @@ def move_resize_window(self, wid, window, x, y, ww, wh, resize_counter):
13831383
return
13841384
self.send("window-move-resize", wid, x, y, ww, wh, resize_counter)
13851385

1386-
def cancel_damage(self, wid, window):
1386+
def cancel_damage(self, wid):
13871387
"""
13881388
Use this method to cancel all currently pending and ongoing
13891389
damage requests for a window.
13901390
"""
1391-
if not self.can_send_window(window):
1392-
return
13931391
ws = self.window_sources.get(wid)
13941392
if ws:
13951393
ws.cancel_damage()
@@ -1432,7 +1430,7 @@ def set_speed(self, speed):
14321430
def refresh(self, wid, window, opts):
14331431
if not self.can_send_window(window):
14341432
return
1435-
self.cancel_damage(wid, window)
1433+
self.cancel_damage(wid)
14361434
w, h = window.get_dimensions()
14371435
self.damage(wid, window, 0, 0, w, h, opts)
14381436

0 commit comments

Comments
 (0)