Skip to content

Commit

Permalink
#901: minor fixes:
Browse files Browse the repository at this point in the history
* clear the backing in destroy code path
* define new success code for paint callbacks for cases where we didn't fail but also didn't actually paint either (ie: when the backing is gone)

git-svn-id: https://xpra.org/svn/Xpra/trunk@10779 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 9, 2015
1 parent 6e26eec commit 190a346
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/xpra/client/client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,11 @@ def draw_region(self, x, y, width, height, coding, img_data, rowstride, packet_s
if not backing:
log("draw_region: window %s has no backing, gone?", self._id)
from xpra.client.window_backing_base import fire_paint_callbacks
fire_paint_callbacks(callbacks, False)
fire_paint_callbacks(callbacks, -1, "no backing")
return
def after_draw_refresh(success, message=""):
plog("after_draw_refresh(%s, %s) %sx%s at %sx%s encoding=%s, options=%s", success, message, width, height, x, y, coding, options)
if not success:
if success<=0:
return
backing = self._backing
if backing and backing.draw_needs_refresh:
Expand Down
1 change: 1 addition & 0 deletions src/xpra/client/gl/gtk2/gl_client_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def destroy(self):
if b:
b.paint_screen = False
b.close()
self._backing = None
GTK2WindowBase.destroy(self)


Expand Down
1 change: 1 addition & 0 deletions src/xpra/client/gl/gtk3/gl_client_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def destroy(self):
if b:
b.paint_screen = False
b.close()
self._backing = None
ClientWindow.destroy(self)


Expand Down
2 changes: 1 addition & 1 deletion src/xpra/client/gtk_base/gtk_client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ def process_configure_event(self, skip_geometry=False):
for window in self._override_redirect_windows:
x, y = window.get_position()
window.move(x+dx, y+dy)
log.info("size=%s, new=%s, backing=%s, iconified=%s", self._size, (w, h), self._backing, self._iconified)
log("configure event: current size=%s, new size=%s, backing=%s, iconified=%s", self._size, (w, h), self._backing, self._iconified)
if (w, h) != self._size or (self._backing is None and not self._iconified):
self._size = (w, h)
self._set_backing_size(w, h)
Expand Down
12 changes: 8 additions & 4 deletions src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2402,15 +2402,19 @@ def free_mmap_area():
paintlog("process_draw %s bytes for window %s using %s encoding with options=%s", len(data), wid, coding, options)
start = time.time()
def record_decode_time(success, message=""):
if success:
if success>0:
end = time.time()
decode_time = int(end*1000*1000-start*1000*1000)
self.pixel_counter.append((start, end, width*height))
dms = "%sms" % (int(decode_time/100)/10.0)
paintlog("record_decode_time(%s) wid=%s, %s: %sx%s, %s", success, wid, coding, width, height, dms)
else:
paintlog("record_decode_time(%s, %s) wid=%s, %s: %sx%s, %s", success, message, wid, coding, width, height, dms)
elif success==0:
decode_time = -1
paintlog("record_decode_time(%s) decoding error on wid=%s, %s: %sx%s", success, wid, coding, width, height)
paintlog("record_decode_time(%s, %s) decoding error on wid=%s, %s: %sx%s", success, message, wid, coding, width, height)
else:
assert success<0
decode_time = 0
paintlog("record_decode_time(%s, %s) decoding or painting skipped on wid=%s, %s: %sx%s", success, message, wid, coding, width, height)
self.send_damage_sequence(wid, packet_sequence, width, height, decode_time, message)
self._draw_counter += 1
if PAINT_FAULT_RATE>0 and (self._draw_counter % PAINT_FAULT_RATE)==0:
Expand Down

0 comments on commit 190a346

Please sign in to comment.