Skip to content

Commit

Permalink
#1086 expose vertical refresh rate for osx clients
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@13822 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 22, 2016
1 parent 5e5d463 commit f108ee7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/xpra/platform/darwin/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,28 @@ def get_window_frame_size(x, y, w, h):
"frame" : (0, 0, 22, 0),
}


def get_vrefresh():
vrefresh = []
try:
from Quartz import CoreGraphics as CG #@UnresolvedImport
err, active_displays, no = CG.CGGetActiveDisplayList(99, None, None)
log("get_vrefresh() %i active displays: %s (err=%i)", no, active_displays, err)
if err==0 and no>0:
for adid in active_displays:
mode = CG.CGDisplayCopyDisplayMode(adid)
v = int(CG.CGDisplayModeGetRefreshRate(mode))
log("get_vrefresh() refresh-rate(%#x)=%i", adid, v)
if v>0:
vrefresh.append(v)
except Exception:
log("failed to query vrefresh for active displays: %s", exc_info=True)
log("get_vrefresh() found %s", vrefresh)
if len(vrefresh)>0:
return min(vrefresh)
return -1


def get_display_icc_info():
info = {}
try:
Expand Down

0 comments on commit f108ee7

Please sign in to comment.