Skip to content

Commit

Permalink
#3411 add debug logging in can_access_display()
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jan 5, 2022
1 parent 36ffb0d commit 2e9a908
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xpra/platform/darwin/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,10 +655,14 @@ def can_access_display() -> bool:
d = Quartz.CGSessionCopyCurrentDictionary()
if not d:
return False
if d.get("kCGSSessionOnConsoleKey", 0)==0:
kCGSSessionOnConsoleKey = d.get("kCGSSessionOnConsoleKey", 0)
log("kCGSSessionOnConsoleKey=%s", kCGSSessionOnConsoleKey)
if kCGSSessionOnConsoleKey==0:
#GUI session doesn't own the console, or the console's screens are asleep
return False
if d.get("CGSSessionScreenIsLocked", 0):
CGSSessionScreenIsLocked = d.get("CGSSessionScreenIsLocked", 0)
log("CGSSessionScreenIsLocked=%s", CGSSessionScreenIsLocked)
if CGSSessionScreenIsLocked:
#screen is locked
return False
return True
Expand Down

0 comments on commit 2e9a908

Please sign in to comment.