Hello community, here is the log from the commit of package xpra for openSUSE:Factory checked in at 2018-12-06 12:17:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xpra (Old) and /work/SRC/openSUSE:Factory/.xpra.new.19453 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xpra" Thu Dec 6 12:17:24 2018 rev:2 rq:654932 version:2.4.2 Changes: -------- --- /work/SRC/openSUSE:Factory/xpra/xpra.changes 2018-11-12 09:38:10.409468929 +0100 +++ /work/SRC/openSUSE:Factory/.xpra.new.19453/xpra.changes 2018-12-06 12:17:25.793512521 +0100 @@ -1,0 +2,31 @@ +Wed Dec 5 09:19:57 UTC 2018 - [email protected] + +- Update to version 2.4.2 + * fix server crash with application setting invalid X11 atoms + * fix missing windows with some mono applications (ignore + invalid X11 atoms) + * fix small X11 memory leak + * fix encoding of empty areas (hard to trigger) + * fix client hangs due to signal-watcher (now disabled with + python2) + * fix virtual printer cleanup errors + * fix leaking xvfb processes when displayfd times out + * fix window size hints not being sanitized correctly + * fix cpu waste and automatic quality calculations + * fix statistics used by shadow servers + * fix error capturing screenshots on MS Windows + * fix logging error in modifier state change failure code path + * fix nvenc errors with odd image heights + * fix over aggressive screen update rectangle merging + * fix race condition causing the connection cleanup code to + run twice + * fix ssh dialog button actions + * ensure Qt applications use the X11 backend so we can + intercept them + * skip unnecessary video tests when mmap is enabled + * handle property change handlers errors more gracefully + * avoid recycling video contexts unnecessarily + * don't flush video encoders when doing a regular content + refresh + +------------------------------------------------------------------- Old: ---- xpra-2.4.1.tar.xz New: ---- xpra-2.4.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xpra.spec ++++++ --- /var/tmp/diff_new_pack.Oo7Cq1/_old 2018-12-06 12:17:26.381511890 +0100 +++ /var/tmp/diff_new_pack.Oo7Cq1/_new 2018-12-06 12:17:26.385511886 +0100 @@ -15,13 +15,15 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + + %{?!python_module:%define python_module() python-%{**} python3-%{**}} %if ! %{defined _fillupdir} %define _fillupdir /var/adm/fillup-templates %endif %global __requires_exclude ^typelib\\(GtkosxApplication\\).*$ Name: xpra -Version: 2.4.1 +Version: 2.4.2 Release: 0 Summary: Remote display server for applications and desktops License: GPL-2.0-or-later AND BSD-3-Clause AND LGPL-3.0-or-later AND MIT @@ -100,14 +102,14 @@ Requires: %{name} = %{version} # websockify is required to allow xpra to listen for an html5 client Requires: python2-websockify +Provides: bundled(js-aurora) +Provides: bundled(js-bencode) +Provides: bundled(js-broadway) +Provides: bundled(js-forge) Provides: bundled(js-jquery) = 3.1.1 Provides: bundled(js-jquery-ui) = 1.12.1 Provides: bundled(js-lz4) Provides: bundled(js-zlib) -Provides: bundled(js-forge) -Provides: bundled(js-aurora) -Provides: bundled(js-broadway) -Provides: bundled(js-bencode) BuildArch: noarch %description html5 ++++++ xpra-2.4.1.tar.xz -> xpra-2.4.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/NEWS new/xpra-2.4.2/NEWS --- old/xpra-2.4.1/NEWS 2018-10-31 17:47:17.000000000 +0100 +++ new/xpra-2.4.2/NEWS 2018-11-23 06:36:08.000000000 +0100 @@ -1,3 +1,28 @@ +v2.4.2 (2018-11-23) +====================== + -- fix server crash with application setting invalid X11 atoms + -- fix missing windows with some mono applications (ignore invalid X11 atoms) + -- fix small X11 memory leak + -- fix encoding of empty areas (hard to trigger) + -- fix client hangs due to signal-watcher (now disabled with python2) + -- fix virtual printer cleanup errors + -- fix leaking xvfb processes when displayfd times out + -- fix window size hints not being sanitized correctly + -- fix cpu waste and automatic quality calculations + -- fix statistics used by shadow servers + -- fix error capturing screenshots on MS Windows + -- fix logging error in modifier state change failure code path + -- fix nvenc errors with odd image heights + -- fix over aggressive screen update rectangle merging + -- fix race condition causing the connection cleanup code to run twice + -- fix ssh dialog button actions + -- ensure Qt applications use the X11 backend so we can intercept them + -- skip unnecessary video tests when mmap is enabled + -- handle property change handlers errors more gracefully + -- avoid recycling video contexts unnecessarily + -- don't flush video encoders when doing a regular content refresh + + v2.4.1 (2018-10-31) ====================== -- fix popup window focus for some Java applications diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/html5/js/Utilities.js new/xpra-2.4.2/html5/js/Utilities.js --- old/xpra-2.4.1/html5/js/Utilities.js 2018-10-31 17:47:17.000000000 +0100 +++ new/xpra-2.4.2/html5/js/Utilities.js 2018-11-13 14:51:47.000000000 +0100 @@ -10,7 +10,7 @@ 'use strict'; var Utilities = { - VERSION : "2.4.1", + VERSION : "2.4.2", error : function() { console.error.apply(console, arguments); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/svn-info new/xpra-2.4.2/svn-info --- old/xpra-2.4.1/svn-info 2018-10-31 17:58:43.000000000 +0100 +++ new/xpra-2.4.2/svn-info 2018-11-23 13:38:17.000000000 +0100 @@ -4,10 +4,10 @@ Relative URL: ^/tags/v2.4.x/src Repository Root: file:///var/svn/repos/Xpra Repository UUID: 3bb7dfac-3a0b-4e04-842a-767bc560f471 -Revision: 20899 +Revision: 21077 Node Kind: directory Schedule: normal Last Changed Author: antoine -Last Changed Rev: 20894 -Last Changed Date: 2018-10-31 14:37:29 +0000 (Wed, 31 Oct 2018) +Last Changed Rev: 21077 +Last Changed Date: 2018-11-23 05:34:41 +0000 (Fri, 23 Nov 2018) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/svn-version new/xpra-2.4.2/svn-version --- old/xpra-2.4.1/svn-version 2018-10-31 17:58:43.000000000 +0100 +++ new/xpra-2.4.2/svn-version 2018-11-23 13:38:17.000000000 +0100 @@ -1 +1 @@ -20899 +21077 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/unittests/unit/client/mixins_test.py new/xpra-2.4.2/unittests/unit/client/mixins_test.py --- old/xpra-2.4.1/unittests/unit/client/mixins_test.py 2018-10-14 18:59:52.000000000 +0200 +++ new/xpra-2.4.2/unittests/unit/client/mixins_test.py 2018-11-23 06:36:07.000000000 +0100 @@ -4,10 +4,11 @@ # Xpra is released under the terms of the GNU GPL v2, or, at your option, any # later version. See the file COPYING for details. +import time import unittest from xpra.util import AdHocStruct, typedict -from xpra.os_util import monotonic_time, get_hex_uuid +from xpra.os_util import get_hex_uuid from xpra.client.mixins.network_state import NetworkState from xpra.client.mixins.mmap import MmapClient from xpra.client.mixins.remote_logging import RemoteLogging @@ -26,7 +27,7 @@ opts.bandwidth_detection = True x.init(opts) assert x.get_caps() is not None - x.server_capabilities = typedict({"start_time" : monotonic_time()}) + x.server_capabilities = typedict({"start_time" : time.time()}) x.parse_server_capabilities() assert x.server_start_time>=x.start_time, "server_start_time=%s vs start_time=%s" % (x.server_start_time, x.start_time) x.uuid = get_hex_uuid() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/win32/MINGW_BUILD.sh new/xpra-2.4.2/win32/MINGW_BUILD.sh --- old/xpra-2.4.1/win32/MINGW_BUILD.sh 2018-10-20 13:34:17.000000000 +0200 +++ new/xpra-2.4.2/win32/MINGW_BUILD.sh 2018-11-01 09:02:42.000000000 +0100 @@ -235,7 +235,7 @@ rm -fr lib/gdk-pixbuf-2.0/2.10.0/loaders mv lib/gdk-pixbuf-2.0/2.10.0/loaders.tmp lib/gdk-pixbuf-2.0/2.10.0/loaders #move libs that are likely to be common to the lib dir: -for prefix in lib avcodec avformat avutil swscale swresample zlib1; do +for prefix in lib avcodec avformat avutil swscale swresample zlib1 xvidcore; do find lib/Xpra -name "${prefix}*dll" -exec mv {} ./lib/ \; done for x in openblas gfortran quadmath; do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/win32/xpra.iss new/xpra-2.4.2/win32/xpra.iss --- old/xpra-2.4.1/win32/xpra.iss 2018-10-31 17:47:17.000000000 +0100 +++ new/xpra-2.4.2/win32/xpra.iss 2018-11-13 14:51:47.000000000 +0100 @@ -1,6 +1,6 @@ [Setup] AppName=Xpra -AppVerName=Xpra 2.4.1 +AppVerName=Xpra 2.4.2 AppPublisher=xpra.org AppPublisherURL=http://xpra.org/ DefaultDirName={pf}\Xpra @@ -13,7 +13,7 @@ Compression=lzma2/max SolidCompression=yes AllowUNCPath=false -VersionInfoVersion=2.4.1 +VersionInfoVersion=2.4.2 VersionInfoCompany=xpra.org VersionInfoDescription=multi-platform screen and application forwarding system WizardImageFile=win32\xpra-logo.bmp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/__init__.py new/xpra-2.4.2/xpra/__init__.py --- old/xpra-2.4.1/xpra/__init__.py 2018-10-31 17:58:44.000000000 +0100 +++ new/xpra-2.4.2/xpra/__init__.py 2018-11-23 13:38:18.000000000 +0100 @@ -4,4 +4,4 @@ # Xpra is released under the terms of the GNU GPL v2, or, at your option, any # later version. See the file COPYING for details. -__version__ = "2.4.1" +__version__ = "2.4.2" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/child_reaper.py new/xpra-2.4.2/xpra/child_reaper.py --- old/xpra-2.4.1/xpra/child_reaper.py 2018-10-14 18:59:57.000000000 +0200 +++ new/xpra-2.4.2/xpra/child_reaper.py 2018-11-04 13:19:19.000000000 +0100 @@ -144,8 +144,8 @@ return True def sigchld(self, signum, frame): - self.glib.idle_add(log, "sigchld(%s, %s)", signum, frame) - self.glib.idle_add(self.reap) + log("sigchld(%s, %s)", signum, frame) + self.reap() def get_proc_info(self, pid): for proc_info in tuple(self._proc_info): @@ -177,7 +177,7 @@ return if process and cb: procinfo.callback = None - cb(process) + self.glib.idle_add(cb, process) #once it's dead, clear the reference to the process: #this should free up some resources #and also help to ensure we don't end up here again diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/client/gtk_base/pass_dialog.py new/xpra-2.4.2/xpra/client/gtk_base/pass_dialog.py --- old/xpra-2.4.1/xpra/client/gtk_base/pass_dialog.py 2018-10-14 18:59:53.000000000 +0200 +++ new/xpra-2.4.2/xpra/client/gtk_base/pass_dialog.py 2018-11-23 06:36:07.000000000 +0100 @@ -68,24 +68,23 @@ al = gtk.Alignment(xalign=1, yalign=0.5, xscale=0, yscale=0) al.add(hbox) vbox.pack_start(al) - for label, code, isdefault in [("Confirm", 0, True), ("Cancel", 1, False)]: - b = self.btn(label, code, isdefault) + for label, isdefault, cb in [ + ("Confirm", True, self.activate), + ("Cancel", False, self.quit), + ]: + b = self.btn(label, isdefault, cb) hbox.pack_start(b) add_close_accel(self.window, self.quit) vbox.show_all() self.window.add(vbox) - def btn(self, label, code, isdefault=False): + def btn(self, label, isdefault=False, cb=None): btn = gtk.Button(label) settings = btn.get_settings() settings.set_property('gtk-button-images', True) - def btn_clicked(*_args): - log("%s button clicked, returning %s", label, code) - self.exit_code = code - self.quit() btn.set_size_request(100, 48) - btn.connect("clicked", btn_clicked) + btn.connect("clicked", cb) btn.set_can_focus(True) btn.set_can_default(isdefault) if isdefault: @@ -117,13 +116,17 @@ self.destroy() gtk.main_quit() - def activate(self, *args): log("activate%s", args) sys.stdout.write(self.password_input.get_text()) sys.stdout.flush() self.quit() + def cancel(self, *args): + log("cancel%s", args) + self.exit_code = 1 + self.quit() + def get_icon(self, icon_name): icon_filename = os.path.join(get_icon_dir(), icon_name) if os.path.exists(icon_filename): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/client/gtk_base/session_info.py new/xpra-2.4.2/xpra/client/gtk_base/session_info.py --- old/xpra-2.4.1/xpra/client/gtk_base/session_info.py 2018-10-25 19:25:43.000000000 +0200 +++ new/xpra-2.4.2/xpra/client/gtk_base/session_info.py 2018-11-23 06:36:07.000000000 +0100 @@ -781,7 +781,8 @@ def populate_connection(self): def settimedeltastr(label, from_time): - delta = datetime.timedelta(seconds=(int(monotonic_time())-int(from_time))) + import time + delta = datetime.timedelta(seconds=(int(time.time())-int(from_time))) label.set_text(str(delta)) if self.client.server_load: self.server_load_label.set_text(" ".join([str(x/1000.0) for x in self.client.server_load])) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/client/mixins/network_state.py new/xpra-2.4.2/xpra/client/mixins/network_state.py --- old/xpra-2.4.1/xpra/client/mixins/network_state.py 2018-10-14 18:59:53.000000000 +0200 +++ new/xpra-2.4.2/xpra/client/mixins/network_state.py 2018-11-23 06:36:07.000000000 +0100 @@ -112,7 +112,9 @@ def parse_server_capabilities(self): c = self.server_capabilities - self.server_start_time = c.intget("start_time", -1) + #make sure the server doesn't provide a start time in the future: + import time + self.server_start_time = min(time.time(), c.intget("start_time", -1)) self.server_bandwidth_limit_change = c.boolget("network.bandwidth-limit-change") self.server_bandwidth_limit = c.intget("network.bandwidth-limit") bandwidthlog("server_bandwidth_limit_change=%s, server_bandwidth_limit=%s", self.server_bandwidth_limit_change, self.server_bandwidth_limit) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/client/mixins/remote_logging.py new/xpra-2.4.2/xpra/client/mixins/remote_logging.py --- old/xpra-2.4.1/xpra/client/mixins/remote_logging.py 2018-10-14 18:59:53.000000000 +0200 +++ new/xpra-2.4.2/xpra/client/mixins/remote_logging.py 2018-11-23 06:36:07.000000000 +0100 @@ -27,6 +27,7 @@ self.in_remote_logging = False self.local_logging = None self.log_both = False + self.monotonic_start_time = monotonic_time() def init(self, opts, _extra_args=[]): self.log_both = (opts.remote_logging or "").lower()=="both" @@ -67,7 +68,7 @@ except: return strtobytes(x) try: - dtime = int(1000*(monotonic_time() - self.start_time)) + dtime = int(1000*(monotonic_time() - self.monotonic_start_time)) data = self.compressed_wrapper("text", enc(msg % args), level=1) self.send("logging", level, data, dtime) exc_info = kwargs.get("exc_info") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/client/mixins/stub_client_mixin.py new/xpra-2.4.2/xpra/client/mixins/stub_client_mixin.py --- old/xpra-2.4.1/xpra/client/mixins/stub_client_mixin.py 2018-10-14 18:59:53.000000000 +0200 +++ new/xpra-2.4.2/xpra/client/mixins/stub_client_mixin.py 2018-11-23 06:36:07.000000000 +0100 @@ -4,8 +4,7 @@ # later version. See the file COPYING for details. import sys - -from xpra.os_util import monotonic_time +import time class StubClientMixin(object): @@ -13,7 +12,7 @@ __signals__ = {} def __init__(self): self.exit_code = None - self.start_time = int(monotonic_time()) + self.start_time = int(time.time()) """ Initialize this instance with the options given. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/client/mixins/window_manager.py new/xpra-2.4.2/xpra/client/mixins/window_manager.py --- old/xpra-2.4.1/xpra/client/mixins/window_manager.py 2018-10-20 18:10:38.000000000 +0200 +++ new/xpra-2.4.2/xpra/client/mixins/window_manager.py 2018-11-13 14:51:47.000000000 +0100 @@ -32,7 +32,7 @@ from xpra.platform.paths import get_icon_filename from xpra.scripts.config import FALSE_OPTIONS from xpra.make_thread import make_thread -from xpra.os_util import BytesIOClass, Queue, bytestostr, monotonic_time, memoryview_to_bytes, OSX, POSIX, is_Ubuntu +from xpra.os_util import BytesIOClass, Queue, bytestostr, monotonic_time, memoryview_to_bytes, OSX, POSIX, PYTHON3, is_Ubuntu from xpra.util import iround, envint, envbool, typedict, make_instance, updict from xpra.client.mixins.stub_client_mixin import StubClientMixin @@ -59,6 +59,7 @@ SAVE_WINDOW_ICONS = envbool("XPRA_SAVE_WINDOW_ICONS", False) SAVE_CURSORS = envbool("XPRA_SAVE_CURSORS", False) MODAL_WINDOWS = envbool("XPRA_MODAL_WINDOWS", False) +SIGNAL_WATCHER = envbool("XPRA_SIGNAL_WATCHER", PYTHON3) DRAW_TYPES = {bytes : "bytes", str : "bytes", tuple : "arrays", list : "arrays"} @@ -720,6 +721,8 @@ ###################################################################### # listen for process signals using a watcher process: def assign_signal_watcher_pid(self, wid, pid): + if not SIGNAL_WATCHER: + return 0 if not POSIX or OSX or not pid: return 0 proc = self._pid_to_signalwatcher.get(pid) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/codecs/nvenc/encoder.pyx new/xpra-2.4.2/xpra/codecs/nvenc/encoder.pyx --- old/xpra-2.4.1/xpra/codecs/nvenc/encoder.pyx 2018-10-24 11:43:12.000000000 +0200 +++ new/xpra-2.4.2/xpra/codecs/nvenc/encoder.pyx 2018-11-23 06:36:07.000000000 +0100 @@ -2239,7 +2239,8 @@ if DEBUG_API: log("copy_image(%s, %s, %i, %i)", image, target_buffer, target_stride, strict_stride) cdef unsigned int image_stride = image.get_rowstride() - cdef unsigned int h = image.get_height() + #input_height may be smaller if we have rounded down: + cdef unsigned int h = min(image.get_height(), self.input_height) cdef unsigned int i, stride, min_stride pixels = image.get_pixels() assert pixels is not None, "failed to get pixels from %s" % image diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/platform/win32/gui.py new/xpra-2.4.2/xpra/platform/win32/gui.py --- old/xpra-2.4.1/xpra/platform/win32/gui.py 2018-10-14 18:59:55.000000000 +0200 +++ new/xpra-2.4.2/xpra/platform/win32/gui.py 2018-11-23 06:36:07.000000000 +0100 @@ -865,7 +865,7 @@ from xpra.platform.win32.gdi_screen_capture import GDICapture gdic = GDICapture() v = gdic.take_screenshot() - gdic.cleanup() + gdic.clean() return v diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/platform/xposix/features.py new/xpra-2.4.2/xpra/platform/xposix/features.py --- old/xpra-2.4.1/xpra/platform/xposix/features.py 2018-10-14 18:59:55.000000000 +0200 +++ new/xpra-2.4.2/xpra/platform/xposix/features.py 2018-11-23 06:36:07.000000000 +0100 @@ -20,6 +20,8 @@ "MWWM=allwm", "#force GTK3 applications to use X11 so we can intercept them:", "GDK_BACKEND=x11", + "#force Qt applications to use X11 so we can intercept them:", + "QT_QPA_PLATFORM=xcb", ] DEFAULT_SSH_CMD = "ssh" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/server/server_base.py new/xpra-2.4.2/xpra/server/server_base.py --- old/xpra-2.4.1/xpra/server/server_base.py 2018-10-14 18:59:56.000000000 +0200 +++ new/xpra-2.4.2/xpra/server/server_base.py 2018-11-23 06:36:08.000000000 +0100 @@ -761,21 +761,16 @@ del self._potential_protocols[protocol] except: pass - source = self._server_sources.get(protocol) + source = self._server_sources.pop(protocol, None) if source: self.cleanup_source(source) - try: - del self._server_sources[protocol] - except: - pass for c in SERVER_BASES: c.cleanup_protocol(self, protocol) return source def cleanup_source(self, source): - had_client = len(self._server_sources)>0 self.server_event("connection-lost", source.uuid) - remaining_sources = tuple(x for x in self._server_sources.values() if x!=source) + remaining_sources = tuple(self._server_sources.values()) if self.ui_driver==source.uuid: if len(remaining_sources)==1: self.set_ui_driver(remaining_sources[0]) @@ -785,7 +780,7 @@ netlog("cleanup_source(%s) remaining sources: %s", source, remaining_sources) netlog.info("xpra client %i disconnected.", source.counter) has_client = len(remaining_sources)>0 - if had_client and not has_client: + if not has_client: self.idle_add(self.last_client_exited) def last_client_exited(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/server/server_core.py new/xpra-2.4.2/xpra/server/server_core.py --- old/xpra-2.4.1/xpra/server/server_core.py 2018-10-14 18:59:56.000000000 +0200 +++ new/xpra-2.4.2/xpra/server/server_core.py 2018-11-23 06:36:08.000000000 +0100 @@ -8,6 +8,7 @@ import os import sys +import time import socket import signal import binascii @@ -169,7 +170,7 @@ def __init__(self): log("ServerCore.__init__()") - self.start_time = monotonic_time() + self.start_time = time.time() self.auth_classes = {} self._when_ready = [] self.child_reaper = None @@ -1673,7 +1674,7 @@ def make_hello(self, source=None): - now = monotonic_time() + now = time.time() capabilities = flatten_dict(get_network_caps()) if source is None or source.wants_versions: capabilities.update(flatten_dict(get_server_info())) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/server/source/fileprint_mixin.py new/xpra-2.4.2/xpra/server/source/fileprint_mixin.py --- old/xpra-2.4.1/xpra/server/source/fileprint_mixin.py 2018-10-14 18:59:56.000000000 +0200 +++ new/xpra-2.4.2/xpra/server/source/fileprint_mixin.py 2018-11-13 14:51:47.000000000 +0100 @@ -58,7 +58,6 @@ log.warn("Warning: client did not supply a UUID,") log.warn(" printer forwarding cannot be enabled") return - from xpra.platform.pycups_printing import remove_printer #remove the printers no longer defined #or those whose definition has changed (and we will re-add them): for k in tuple(self.printers.keys()): @@ -80,11 +79,9 @@ #remove it: try: del self.printers[k] - remove_printer(k) - except Exception as e: - log.error("Error: failed to remove printer %s:", k) - log.error(" %s", e) - del e + except KeyError: + pass + self.remove_printer(k) #expand it here so the xpraforwarder doesn't need to import anything xpra: attributes = {"display" : os.environ.get("DISPLAY"), "source" : self.uuid} @@ -150,5 +147,13 @@ printers = self.printers.copy() self.printers = {} for k in printers: + self.remove_printer(k) + + def remove_printer(self, printer): + try: from xpra.platform.pycups_printing import remove_printer - remove_printer(k) + remove_printer(printer) + except Exception as e: + log("remove_printer(%s)", printer, exc_info=True) + log.error("Error: failed to remove printer %s:", printer) + log.error(" %s", e) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/server/window/batch_delay_calculator.py new/xpra-2.4.2/xpra/server/window/batch_delay_calculator.py --- old/xpra-2.4.1/xpra/server/window/batch_delay_calculator.py 2018-10-14 18:59:56.000000000 +0200 +++ new/xpra-2.4.2/xpra/server/window/batch_delay_calculator.py 2018-11-23 06:36:08.000000000 +0100 @@ -220,8 +220,8 @@ # here we try minimize client-latency, packet-backlog and batch.delay # the compression ratio tells us if we can increase the quality packets_backlog, pixels_backlog, _ = statistics.get_client_backlog() - pb_ratio = pixels_backlog/low_limit - pixels_bl = 1.0 - logp(pb_ratio//4) #4 frames behind -> min quality + pb_ratio = float(pixels_backlog)/low_limit + pixels_bl = 1.0 - logp(pb_ratio/4.0) #4 frames behind -> min quality info["backlog_factor"] = packets_backlog, pixels_backlog, low_limit, int(pb_ratio), int(100.0*pixels_bl) target = pixels_bl if batch is not None: @@ -281,16 +281,18 @@ #raise the quality when there are not many recent damage events: ww, wh = window_dimensions if ww>0 and wh>0: - now = monotonic_time() - damage_pixel_count = dict((lim, sum([w*h for t,_,_,w,h in tuple(statistics.last_damage_events) if t>=now-lim and t<now-lim+1])) for lim in range(1,11)) - pixl5 = sum(v for lim,v in damage_pixel_count.items() if lim<=5) - pixn5 = sum(v for lim,v in damage_pixel_count.items() if lim>5) - pctpixdamaged = float(pixl5)/(ww*wh) - log("get_target_quality: target=%i%% (window %ix%i) pctpixdamaged=%i%%, dpc=%s", 100*target, ww, wh, pctpixdamaged*100, damage_pixel_count) - if pctpixdamaged<=0.5: - target = min(1.0, target + (1.0-pctpixdamaged*2)) - if pixl5<pixn5: - target = sqrt(target) + lde = tuple(statistics.last_damage_events) + if lde: + now = monotonic_time() + damage_pixel_count = tuple((lim, sum([w*h for t,_,_,w,h in lde if t>=now-lim and t<now-lim+1])) for lim in range(1,11)) + pixl5 = sum(v for lim,v in damage_pixel_count if lim<=5) + pixn5 = sum(v for lim,v in damage_pixel_count if lim>5) + pctpixdamaged = float(pixl5)/(ww*wh) + log("get_target_quality: target=%3i%% (window %4ix%-4i) pctpixdamaged=%3i%%, dpc=%s", 100*target, ww, wh, pctpixdamaged*100, damage_pixel_count) + if pctpixdamaged<0.5: + target *= (1.5-pctpixdamaged) + if pixl5<pixn5: + target = sqrt(target) #discount for congestion: target /= (1.0 + global_statistics.congestion_value*10) #apply min-quality: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/server/window/window_source.py new/xpra-2.4.2/xpra/server/window/window_source.py --- old/xpra-2.4.1/xpra/server/window/window_source.py 2018-10-25 19:25:44.000000000 +0200 +++ new/xpra-2.4.2/xpra/server/window/window_source.py 2018-11-23 06:36:08.000000000 +0100 @@ -1129,7 +1129,7 @@ damagelog("damage%s window size %ix%i ignored", (x, y, w, h, options), ww, wh) return now = monotonic_time() - if not options.get("auto_refresh", False) and not options.get("polling", False): + if not options.get("auto_refresh", False) and not options.get("polling", False) and not self.is_shadow: self.statistics.last_damage_events.append((now, x,y,w,h)) self.global_statistics.damage_events_count += 1 self.statistics.damage_events_count += 1 @@ -1498,13 +1498,11 @@ return elif len(regions)==1: merged = regions[0] - else: - merged = merge_all(regions) - #if we find one region covering almost the entire window, - #refresh the whole window (ie: when the video encoder mask rounded the dimensions down) - if merged.x<=1 and merged.y<=1 and abs(ww-merged.width)<2 and abs(wh-merged.height)<2: - send_full_window_update() - return + #if we find one region covering almost the entire window, + #refresh the whole window (ie: when the video encoder mask rounded the dimensions down) + if merged.x<=1 and merged.y<=1 and abs(ww-merged.width)<2 and abs(wh-merged.height)<2: + send_full_window_update() + return #we're processing a number of regions separately, #start by removing the exclude region if there is one: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/server/window/window_video_source.py new/xpra-2.4.2/xpra/server/window/window_video_source.py --- old/xpra-2.4.1/xpra/server/window/window_video_source.py 2018-10-14 18:59:56.000000000 +0200 +++ new/xpra-2.4.2/xpra/server/window/window_video_source.py 2018-11-23 06:36:08.000000000 +0100 @@ -431,7 +431,7 @@ #raise the quality as the areas around video tend to not be graphics return nonvideo(quality+30, "not the video region") - if now-self.global_statistics.last_congestion_time>5: + if now-self.global_statistics.last_congestion_time>5 and not self.is_shadow: lde = tuple(self.statistics.last_damage_events) lim = now-4 pixels_last_4secs = sum(w*h for when,_,_,w,h in lde if when>lim) @@ -571,11 +571,6 @@ WindowSource.client_decode_error(self, error, message) - def timer_full_refresh(self): - self.flush_video_encoder_now() - WindowSource.timer_full_refresh(self) - - def get_refresh_exclude(self): #exclude video region (if any) from lossless refresh: return self.video_subregion.rectangle @@ -849,16 +844,17 @@ if coding in self.video_encodings and self.edge_encoding and not VIDEO_SKIP_EDGE: dw = w - (w & self.width_mask) dh = h - (h & self.height_mask) - if dw>0: + if dw>0 and h>0: sub = image.get_sub_image(w-dw, 0, dw, h) call_encode(dw, h, sub, self.edge_encoding, flush+1+int(dh>0)) w = w & self.width_mask - if dh>0: + if dh>0 and w>0: sub = image.get_sub_image(0, h-dh, w, dh) call_encode(dw, h, sub, self.edge_encoding, flush+1) h = h & self.height_mask #the main area: - call_encode(w, h, image, coding, flush) + if w>0 and h>0: + call_encode(w, h, image, coding, flush) def get_frame_encode_delay(self, options): if FORCE_AV_DELAY>0: @@ -995,8 +991,18 @@ ww, wh = self.window_dimensions vs.identify_video_subregion(ww, wh, self.statistics.damage_events_count, self.statistics.last_damage_events, self.statistics.last_resized) newrect = vs.rectangle - if newrect is None or old is None or newrect!=old: - self.cleanup_codecs() + if ((newrect is None) ^ (old is None)) or newrect!=old: + if old is None and newrect and newrect.get_geometry()==(0, 0, ww, wh): + #not actually changed! + #the region is the whole window + pass + elif newrect is None and old and old.get_geometry()==(0, 0, ww, wh): + #not actually changed! + #the region is the whole window + pass + else: + videolog("video subregion was %s, now %s (window size: %i,%i)", old, newrect, ww, wh) + self.cleanup_codecs() if newrect: #remove this from regular refresh: if old is None or old!=newrect: @@ -1032,6 +1038,9 @@ Can be called from any thread. """ + if self._mmap and self._mmap_size>0: + scorelog("cannot score: mmap enabled") + return elapsed = monotonic_time()-self._last_pipeline_check max_elapsed = 0.75 if self.is_idle: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/src_info.py new/xpra-2.4.2/xpra/src_info.py --- old/xpra-2.4.1/xpra/src_info.py 2018-10-31 17:58:43.000000000 +0100 +++ new/xpra-2.4.2/xpra/src_info.py 2018-11-23 13:38:17.000000000 +0100 @@ -1,2 +1,2 @@ LOCAL_MODIFICATIONS=0 -REVISION=20899 +REVISION=21077 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/x11/bindings/core_bindings.pyx new/xpra-2.4.2/xpra/x11/bindings/core_bindings.pyx --- old/xpra-2.4.1/xpra/x11/bindings/core_bindings.pyx 2018-10-14 18:59:56.000000000 +0200 +++ new/xpra-2.4.2/xpra/x11/bindings/core_bindings.pyx 2018-11-04 13:19:19.000000000 +0100 @@ -133,8 +133,12 @@ def XGetAtomName(self, Atom atom): self.context_check() - v = XGetAtomName(self.display, atom) - return v[:] + cdef char *v = XGetAtomName(self.display, atom) + if v==NULL: + return None + r = v[:] + XFree(v) + return r def get_error_text(self, code): assert self.display!=NULL, "display is closed" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/x11/gtk2/models/core.py new/xpra-2.4.2/xpra/x11/gtk2/models/core.py --- old/xpra-2.4.1/xpra/x11/gtk2/models/core.py 2018-10-14 18:59:56.000000000 +0200 +++ new/xpra-2.4.2/xpra/x11/gtk2/models/core.py 2018-11-04 13:19:19.000000000 +0100 @@ -482,7 +482,12 @@ return handler = self._x11_property_handlers.get(name) if handler: - handler(self) + try: + handler(self) + except XError as e: + log("_handle_property_change", exc_info=True) + log.error("Error processing property change for '%s':", name) + log.error(" %s", e) #specific properties: def _handle_pid_change(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/x11/gtk2/models/size_hints_util.py new/xpra-2.4.2/xpra/x11/gtk2/models/size_hints_util.py --- old/xpra-2.4.1/xpra/x11/gtk2/models/size_hints_util.py 2018-10-14 18:59:56.000000000 +0200 +++ new/xpra-2.4.2/xpra/x11/gtk2/models/size_hints_util.py 2018-11-15 17:41:03.000000000 +0100 @@ -39,7 +39,7 @@ if f is None or f<=0 or f>=MAX_ASPECT: log.warn("clearing invalid aspect hint value for %s: %s", attr, v) del size_hints[attr] - for attr in ["max_size", "min_size", "base_size", "resize_inc", + for attr in ["maximum-size", "minimum-size", "base-size", "increment", "min_aspect_ratio", "max_aspect_ratio"]: v = size_hints.get(attr) if v is not None: @@ -51,19 +51,19 @@ log("clearing invalid size hint value for %s: %s", attr, v) del size_hints[attr] #if max-size is smaller than min-size (bogus), clamp it.. - mins = size_hints.get("min_size") - maxs = size_hints.get("max_size") + mins = size_hints.get("minimum-size") + maxs = size_hints.get("maximum-size") if mins is not None and maxs is not None: minw,minh = mins maxw,maxh = maxs if minw<=0 and minh<=0: #doesn't do anything - size_hints["min_size"] = None + size_hints["minimum-size"] = None if maxw<=0 or maxh<=0: #doesn't mak sense! - size_hints["max_size"] = None + size_hints["maximum-size"] = None if maxw<minw or maxh<minh: - size_hints["min_size"] = max(minw, maxw), max(minh, maxh) - size_hints["max_size"] = size_hints.min_size + size_hints["minimum-size"] = max(minw, maxw), max(minh, maxh) + size_hints["maximum-size"] = size_hints.min_size log.warn("invalid min_size=%s / max_size=%s changed to: %s / %s", - mins, maxs, size_hints["min_size"], size_hints["max_size"]) + mins, maxs, size_hints["minimum-size"], size_hints["maximum-size"]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/x11/gtk_x11/prop.py new/xpra-2.4.2/xpra/x11/gtk_x11/prop.py --- old/xpra-2.4.1/xpra/x11/gtk_x11/prop.py 2018-10-14 18:59:56.000000000 +0200 +++ new/xpra-2.4.2/xpra/x11/gtk_x11/prop.py 2018-11-13 14:51:47.000000000 +0100 @@ -56,6 +56,9 @@ def _get_atom(_disp, d): unpacked = struct.unpack(b"@I", d)[0] + if unpacked==0: + log.warn("Warning: invalid zero atom value") + return None with xsync: pyatom = X11Window.XGetAtomName(unpacked) if not pyatom: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/x11/server_keyboard_config.py new/xpra-2.4.2/xpra/x11/server_keyboard_config.py --- old/xpra-2.4.1/xpra/x11/server_keyboard_config.py 2018-10-14 18:59:57.000000000 +0200 +++ new/xpra-2.4.2/xpra/x11/server_keyboard_config.py 2018-11-23 06:36:08.000000000 +0100 @@ -532,7 +532,7 @@ break #we're done for this modifier log("%s %s with keycode %s did not work", info, modifier, keycode) if press and not nuisance: - log(" trying to unpress it!", info, modifier, keycode) + log(" trying to unpress it!") X11Keyboard.xtest_fake_key(keycode, False) #maybe doing the full keypress (down+up) worked: new_mask = self.get_current_mask() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpra-2.4.1/xpra/x11/vfb_util.py new/xpra-2.4.2/xpra/x11/vfb_util.py --- old/xpra-2.4.1/xpra/x11/vfb_util.py 2018-10-14 18:59:57.000000000 +0200 +++ new/xpra-2.4.2/xpra/x11/vfb_util.py 2018-11-13 14:51:47.000000000 +0100 @@ -34,6 +34,11 @@ vfb_logger = Logger("server", "x11") return vfb_logger +def osclose(fd): + try: + os.close(fd) + except: + pass def create_xorg_device_configs(xorg_conf_dir, device_uuid, uid, gid): log = get_vfb_logger() @@ -231,9 +236,24 @@ log("Popen%s", (xvfb_cmd, xvfb_executable, cwd), exc_info=True) raise InitException("failed to execute xvfb command %s: %s" % (xvfb_cmd, e)) # Read the display number from the pipe we gave to Xvfb - buf = read_displayfd(r_pipe) - os.close(r_pipe) - os.close(w_pipe) + e = None + try: + buf = read_displayfd(r_pipe) + except Exception as e: + raise + finally: + osclose(r_pipe) + osclose(w_pipe) + if e: + log.error("Error reading displayfd pipe %s:", r_pipe) + log.error(" %s", e) + if xvfb.poll() is None: + log.error(" stopping vfb process with pid %i", xvfb.pid) + try: + xvfb.terminate() + except Exception as e: + log.error("Error stopping vfb process:") + log.error(" %s", e) def displayfd_err(msg): raise InitException("%s: %s" % (xvfb_executable, msg)) n = parse_displayfd(buf, displayfd_err)
