diff --git a/src/xpra/client/ui_client_base.py b/src/xpra/client/ui_client_base.py index 9ad78b4cc7..4696901f1d 100644 --- a/src/xpra/client/ui_client_base.py +++ b/src/xpra/client/ui_client_base.py @@ -45,7 +45,7 @@ from xpra.client.client_tray import ClientTray from xpra.client.keyboard_helper import KeyboardHelper from xpra.platform.features import MMAP_SUPPORTED, SYSTEM_TRAY_SUPPORTED, CLIPBOARD_WANT_TARGETS, CLIPBOARD_GREEDY, CLIPBOARDS, REINIT_WINDOWS -from xpra.platform.gui import (ready as gui_ready, get_vrefresh, get_antialias_info, get_icc_info, get_double_click_time, show_desktop, get_cursor_size, +from xpra.platform.gui import (ready as gui_ready, get_vrefresh, get_antialias_info, get_icc_info, get_display_icc_info, get_double_click_time, show_desktop, get_cursor_size, get_double_click_distance, get_native_notifier_classes, get_native_tray_classes, get_native_system_tray_classes, get_native_tray_menu_helper_classes, get_xdpi, get_ydpi, get_number_of_desktops, get_desktop_names, get_wm_name, ClientExtras) from xpra.platform.paths import get_tray_icon_filename @@ -1467,9 +1467,12 @@ def make_hello(self): "rgb24zlib" : True, "max-soft-expired" : MAX_SOFT_EXPIRED, }) - capabilities["antialias"] = get_antialias_info() - capabilities["icc"] = get_icc_info() - capabilities["cursor.size"] = int(2*get_cursor_size()/(self.xscale+self.yscale)) + capabilities.update({ + "antialias" : get_antialias_info(), + "icc" : get_icc_info(), + "display-icc" : get_display_icc_info(), + "cursor.size" : int(2*get_cursor_size()/(self.xscale+self.yscale)), + }) #generic rgb compression flags: for x in compression.ALL_COMPRESSORS: capabilities["encoding.rgb_%s" % x] = x in compression.get_enabled_compressors() @@ -2939,7 +2942,7 @@ def free_mmap_area(): if len(packet)>10: options = packet[10] options = typedict(options) - paintlog("process_draw %s bytes for window %s using %s encoding with options=%s", len(data), wid, coding, options) + paintlog.warn("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>0: diff --git a/src/xpra/platform/darwin/gui.py b/src/xpra/platform/darwin/gui.py index 5344b5ddf0..e3ad1ff717 100644 --- a/src/xpra/platform/darwin/gui.py +++ b/src/xpra/platform/darwin/gui.py @@ -126,51 +126,27 @@ def get_window_frame_size(x, y, w, h): "frame" : (0, 0, 22, 0), } - -def get_icc_info(): +def get_display_icc_info(): + info = {} try: - from AppKit import NSScreen #@UnresolvedImport - except ImportError as e: - log("cannot get icc info without AppKit: %s", e) - return {} - ms = NSScreen.mainScreen() - info = do_get_screen_icc_info(ms) - screens = NSScreen.screens() - for i, screen in enumerate(screens): - si = do_get_screen_icc_info(screen) - if si: - info[i] = si + from Quartz import CoreGraphics as CG #@UnresolvedImport + err, active_displays, no = CG.CGGetActiveDisplayList(99, None, None) + if err==0 and no>0: + for i,adid in enumerate(active_displays): + info[i] = get_colorspace_info(CG.CGDisplayCopyColorSpace(adid)) + except Exception as e: + log("failed to query colorspace for active displays: %s", e) return info -def do_get_screen_icc_info(nsscreen): +def get_icc_info(): + #maybe we shouldn't return anything if there's more than one display? info = {} try: - from AppKit import NSUnknownColorSpaceModel, NSGrayColorSpaceModel, NSRGBColorSpaceModel, NSCMYKColorSpaceModel, NSLABColorSpaceModel, NSDeviceNColorSpaceModel, NSIndexedColorSpaceModel, NSPatternColorSpaceModel #@UnresolvedImport - COLORSPACE_STR = { - NSUnknownColorSpaceModel : "unknown", - NSGrayColorSpaceModel : "gray", - NSRGBColorSpaceModel : "RGB", - NSCMYKColorSpaceModel : "CMYK", - NSLABColorSpaceModel : "LAB", - NSDeviceNColorSpaceModel : "DeviceN", - NSIndexedColorSpaceModel : "Indexed", - NSPatternColorSpaceModel : "Pattern", - } - try: - mscs = nsscreen.colorSpace() - except AttributeError as e: - #OSX 10.5.x and earlier don't have this attribute - return info - log("%s.colorSpace=%s", nsscreen, mscs) - info.update({ - "colorspace" : COLORSPACE_STR.get(mscs.colorSpaceModel(), "unknown"), - "data" : str(mscs.ICCProfileData() or ""), - "name" : str(mscs.localizedName()), - "components" : mscs.numberOfColorComponents(), - }) + from Quartz import CoreGraphics as CG #@UnresolvedImport + did = CG.CGMainDisplayID() + info = get_colorspace_info(CG.CGDisplayCopyColorSpace(did)) except Exception as e: - log.warn("Warning: cannot query ICC profiles:") - log.warn(" %s", e) + log("failed to query colorspace for main display: %s", e) return info @@ -273,12 +249,13 @@ def recttotuple(r): ) info = _call_CG_conv(defs, did) try: + from Quartz import CoreGraphics as CG #@UnresolvedImport modes = CG.CGDisplayCopyAllDisplayModes(did, None) info["modes"] = get_display_modes_info(modes) except Exception as e: log("failed to query display modes: %s", e) return info - + def get_displays_info(): from Quartz import CoreGraphics as CG #@UnresolvedImport did = CG.CGMainDisplayID() diff --git a/src/xpra/platform/gui.py b/src/xpra/platform/gui.py index 85f8012945..741530c990 100755 --- a/src/xpra/platform/gui.py +++ b/src/xpra/platform/gui.py @@ -78,6 +78,10 @@ def get_icon_size(): def get_antialias_info(): return {} +def get_display_icc_info(): + #per display info + return {} + def get_icc_info(): from xpra.log import Logger log = Logger("platform") @@ -228,6 +232,7 @@ def fnames(l): }, "antialias" : get_antialias_info(), "icc" : get_icc_info(), + "display-icc" : get_display_icc_info(), "window_frame" : get_window_frame_sizes(), } @@ -250,7 +255,7 @@ def fnames(l): "get_native_notifier_classes", "get_vrefresh", "get_workarea", "get_workareas", "get_number_of_desktops", "get_desktop_names", - "get_antialias_info", "get_icc_info", "get_xdpi", "get_ydpi", + "get_antialias_info", "get_icc_info", "get_display_icc_info", "get_xdpi", "get_ydpi", "get_icon_size", "get_mouse_config", "get_double_click_time", "get_double_click_distance",