Skip to content

Commit

Permalink
paint failures on a closed backing should not trigger error messages
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@10902 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 18, 2015
1 parent b840f8e commit a6804e8
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/xpra/client/window_backing_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,18 +275,20 @@ def do_paint_rgb24(self, img_data, x, y, width, height, rowstride, options, call
the actual paint code is in _do_paint_rgb24
"""
try:
success = (self._backing is not None) and self._do_paint_rgb24(img_data, x, y, width, height, rowstride, options)
if self._backing is None:
fire_paint_callbacks(callbacks, -1, "no backing")
return
success = self._do_paint_rgb24(img_data, x, y, width, height, rowstride, options)
fire_paint_callbacks(callbacks, success)
except KeyboardInterrupt:
raise
except Exception as e:
if not self._backing:
message = "paint error on closed backing ignored"
log(message)
fire_paint_callbacks(callbacks, -1, "paint error on closed backing ignored")
else:
log.error("do_paint_rgb24 error", exc_info=True)
message = "do_paint_rgb24 error: %s" % e
fire_paint_callbacks(callbacks, False, message)
fire_paint_callbacks(callbacks, False, message)

def _do_paint_rgb24(self, img_data, x, y, width, height, rowstride, options):
raise Exception("override me!")
Expand All @@ -306,13 +308,19 @@ def do_paint_rgb32(self, img_data, x, y, width, height, rowstride, options, call
the actual paint code is in _do_paint_rgb32
"""
try:
success = (self._backing is not None) and self._do_paint_rgb32(img_data, x, y, width, height, rowstride, options)
if self._backing is None:
fire_paint_callbacks(callbacks, -1, "no backing")
return
success = self._do_paint_rgb32(img_data, x, y, width, height, rowstride, options)
fire_paint_callbacks(callbacks, success)
except KeyboardInterrupt:
raise
except Exception as e:
log.error("do_paint_rgb32 error", exc_info=True)
fire_paint_callbacks(callbacks, False, "do_paint_rgb32 error: %s" % e)
if not self._backing:
fire_paint_callbacks(callbacks, -1, "paint error on closed backing ignored")
else:
log.error("do_paint_rgb32 error", exc_info=True)
fire_paint_callbacks(callbacks, False, "do_paint_rgb32 error: %s" % e)

def _do_paint_rgb32(self, img_data, x, y, width, height, rowstride, options):
raise Exception("override me!")
Expand Down Expand Up @@ -356,7 +364,7 @@ def paint_with_video_decoder(self, decoder_module, coding, img_data, x, y, width
if self._backing is None:
message = "window %s is already gone!" % self.wid
log(message)
fire_paint_callbacks(callbacks, False, message)
fire_paint_callbacks(callbacks, -1, message)
return False
enc_width, enc_height = options.intpair("scaled_size", (width, height))
input_colorspace = options.strget("csc")
Expand Down Expand Up @@ -516,7 +524,7 @@ def draw_region(self, x, y, width, height, coding, img_data, rowstride, options,
self.do_draw_region(x, y, width, height, coding, img_data, rowstride, options, callbacks)
except Exception:
if self._backing is None:
fire_paint_callbacks(callbacks, False, "this backing is closed - retry?")
fire_paint_callbacks(callbacks, -1, "this backing is closed - retry?")
else:
raise

Expand Down

0 comments on commit a6804e8

Please sign in to comment.