Skip to content

Commit

Permalink
#1155: expose global icc info we get from pillow
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@12282 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 30, 2016
1 parent aa0576e commit 29a9d66
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,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_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_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, ClientExtras)
from xpra.codecs.loader import load_codecs, codec_versions, has_codec, get_codec, PREFERED_ENCODING_ORDER, PROBLEMATIC_ENCODINGS
Expand Down Expand Up @@ -1453,6 +1453,7 @@ def make_hello(self):
"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))
#generic rgb compression flags:
for x in compression.ALL_COMPRESSORS:
Expand Down
31 changes: 30 additions & 1 deletion src/xpra/platform/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,33 @@ def get_icon_size():
def get_antialias_info():
return {}

def get_icc_info():
from xpra.log import Logger
log = Logger("platform")
info = {}
try:
from PIL.ImageCms import get_display_profile, \
getProfileName, getProfileInfo, getProfileCopyright, getProfileManufacturer, getProfileModel, getProfileDescription
p = get_display_profile()
if p:
for (k, fn) in {
"name" : getProfileName,
"info" : getProfileInfo,
"copyright" : getProfileCopyright,
"manufacturer" : getProfileManufacturer,
"model" : getProfileModel,
"description" : getProfileDescription,
}.items():
try:
v = fn(p)
info[k] = v
except Exception as e:
log("ICC profile error on %s using %s: %s", k, fn, e)
except Exception as e:
log.warn("Warning: cannot query ICC profiles:")
log.warn(" %s", e)
return info

#global workarea for all screens
def get_workarea():
return None
Expand Down Expand Up @@ -177,6 +204,7 @@ def fnames(l):
"y" : get_ydpi(),
},
"antialias" : get_antialias_info(),
"icc" : get_icc_info(),
"window_frame" : get_window_frame_sizes(),
}

Expand All @@ -198,7 +226,8 @@ def fnames(l):
"get_native_notifier_classes",
"get_vrefresh", "get_workarea", "get_workareas",
"get_number_of_desktops", "get_desktop_names",
"get_antialias_info", "get_icon_size", "get_xdpi", "get_ydpi",
"get_antialias_info", "get_icc_info", "get_xdpi", "get_ydpi",
"get_icon_size",
"get_mouse_config",
"get_double_click_time", "get_double_click_distance",
"get_fixed_cursor_size", "get_cursor_size", "get_window_frame_sizes",
Expand Down

0 comments on commit 29a9d66

Please sign in to comment.