Session, login & lock
functionSLSSessionCopyCurrentSessionPropertiescprobed
The login session's properties, including whether the screen is locked. The observed dictionary has 15 keys; note the inconsistent naming — the lock keys have no
k prefix (CGSSessionScreenIsLocked, CGSSessionScreenLockedTime) while most others do (kCGSSessionOnConsoleKey, kCGSSessionUserNameKey, kCGSSessionSecureInputPID). This is the supported way to observe lock state without polling the UI.Swift
typealias CopySessionProperties = @convention(c) (Int32) -> Unmanaged<CFDictionary>?
let props = unsafeBitCast(dlsym(lib, "SLSSessionCopyCurrentSessionProperties")!,
to: CopySessionProperties.self)(cid)?.takeRetainedValue() as? [String: Any]
let locked = props?["CGSSessionScreenIsLocked"] as? Bool ?? false
let onConsole = props?["kCGSSessionOnConsoleKey"] as? Bool ?? falseCFDictionaryRef SLSSessionCopyCurrentSessionProperties(int cid);
also exported by CoreGraphics as
CGSSessionCopyCurrentSessionPropertiesNo published signature
| symbol | kind | CoreGraphics name |
|---|---|---|
| SLSConsoleDisplayGetCurrentVBLDeltaInNanoseconds | function | |
| SLSConsoleDisplayGetPriorVBLTimeInNanoseconds | function | |
| SLSConsoleDisplayGetTiming | function | |
| SLSConsoleSetUpdatesAllowed | function | |
| SLSCopyAllSessionPropertiesTemporaryBridge | function | |
| SLSCopyCurrentSessionDictionary | function | CGSCopyCurrentSessionDictionary |
| SLSCopySessionList | function | CGSCopySessionList |
| SLSCopySessionPropertiesTemporaryBridge | function | |
| SLSCosmeticShieldCursor | function | CGSCosmeticShieldCursor |
| SLSCreateLoginSession | function | CGSCreateLoginSession |
| SLSCreateLoginSessionWithDataAndVisibility | function | CGSCreateLoginSessionWithDataAndVisibility |
| SLSCreateSession | function | CGSCreateSession |
| SLSCreateSessionTemporaryBridge | function | |
| SLSCreateSessionWithDataAndOptions | function | CGSCreateSessionWithDataAndOptions |
| SLSCreateSessionWithDataAndVisibility | function | CGSCreateSessionWithDataAndVisibility |
| SLSFindSessionAuditSessionID | function | |
| SLSGetLoginName | function | CGSGetLoginName |
| SLSGetSessionUID | function | |
| SLSMoveSessionToConsoleTemporaryBridge | function | |
| SLSPackagesInitializeSessionPreferences | function | |
| SLSPersistenceCopySessionBitmapKey | function | |
| SLSPersistenceGetSessionStatus | function | |
| SLSPersistenceSetSessionBitmapKey | function | |
| SLSPersistenceSetSessionStatus | function | |
| SLSPersistenceWillTerminateSession | function | CGSPersistenceWillTerminateSession |
| SLSReleaseSession | function | CGSReleaseSession |
| SLSReleaseSessionTemporaryBridge | function | |
| SLSSessionCopyAllSessionProperties | function | CGSSessionCopyAllSessionProperties |
| SLSSessionCopyCurrentSessionReadOnceData | function | CGSSessionCopyCurrentSessionReadOnceData |
| SLSSessionCreateLoginSessionID | function | CGSSessionCreateLoginSessionID |
| SLSSessionCreateSessionIDWithOptions | function | CGSSessionCreateSessionIDWithOptions |
| SLSSessionFullScreenAppPid | function | CGSSessionFullScreenAppPid |
| SLSSessionHasExcludeShapes | function | |
| SLSSessionIDGetFullScreenAppPid | function | CGSSessionIDGetFullScreenAppPid |
| SLSSessionIDSetScreenLockWindowID | function | CGSSessionIDSetScreenLockWindowID |
| SLSSessionIDSetSleepWindowID | function | CGSSessionIDSetSleepWindowID |
| SLSSessionReleaseSessionID | function | CGSSessionReleaseSessionID |
| SLSSessionSetApplicationBindingsForWorkspaces | function | CGSSessionSetApplicationBindingsForWorkspaces |
| SLSSessionSetCurrentSessionProperties | function | CGSSessionSetCurrentSessionProperties |
| SLSSessionSetCurrentSessionWorkspaceApplicationBindings | function | CGSSessionSetCurrentSessionWorkspaceApplicationBindings |
| SLSSessionSetCurrentSessionWorkspaceLaunchPath | function | CGSSessionSetCurrentSessionWorkspaceLaunchPath |
| SLSSessionSetCurrentSessionWorkspaceNotificationConnectionID | function | CGSSessionSetCurrentSessionWorkspaceNotificationConnectionID |
| SLSSessionSetCurrentSessionWorkspacePreferences | function | CGSSessionSetCurrentSessionWorkspacePreferences |
| SLSSessionSetNotificationConnectionForWorkspaces | function | CGSSessionSetNotificationConnectionForWorkspaces |
| SLSSessionSetPreferencesForWorkspaces | function | CGSSessionSetPreferencesForWorkspaces |
| SLSSessionSwitchToAuditSessionID | function | |
| SLSSessionSwitchToAuditSessionIDWithOptions | function | |
| SLSSessionSwitchToSessionID | function | CGSSessionSwitchToSessionID |
| SLSSetDictionaryForCurrentSession | function | CGSSetDictionaryForCurrentSession |
| SLSSetLoginName | function | CGSSetLoginName |
| SLSSetLoginwindowConnection | function | CGSSetLoginwindowConnection |
| SLSSetSessionPropertiesTemporaryBridge | function | |
| SLSSetSessionSwitchCubeAnimation | function | CGSSetSessionSwitchCubeAnimation |
| SLSShieldCursor | function | CGSShieldCursor |
| SLSSuperShieldingWindowID | function | CGSSuperShieldingWindowID |
| SLSSwitchConsoleToSession | function | CGSSwitchConsoleToSession |
| SLSUpdateCurrentSessionWorkspaceData | function | CGSUpdateCurrentSessionWorkspaceData |
| SLSessionCopyCurrentDictionary | function | CGSessionCopyCurrentDictionary |
| SLSessionOwnerCopyXPCSerializationAndInvalidate | function | |
| SLSessionOwnerCreateBySettingLoginwindowConnection | function | |
| SLSessionOwnerCreateNewSessionWithAuditSessionID | function | |
| SLSessionOwnerCreateWithPort | function | |
| SLSessionOwnerCreateWithXPCSerialization | function | |
| SLSessionOwnerGetAuditSessionID | function | |
| SLSessionOwnerGetSessionID | function | |
| SLSessionOwnerIsValid | function | |
| SLShieldingWindowID | function | CGShieldingWindowID |
| SLShieldingWindowLevel | function | CGShieldingWindowLevel |
| kSLDisplayStreamSelectiveSharingSession | data | |
| kSLSConnectionNeedsSafeAreaInsetShield | data | |
| kSLSCoordinatedLoginNotificationName | data | |
| kSLSCoordinatedScreenLockNotificationName | data | |
| kSLSSessionSwitchTransitionTypeCube | data | |
| kSLSSessionSwitchTransitionTypeKey | data | |
| kSLSSessionSwitchTransitionTypeNone | data | |
| kSLSSessionSwitchTransitionTypeUnset | data | |
| kSLSSpaceAbsoluteLevelNotificationCenterAtScreenLock | data | |
| kSLSSpaceAbsoluteLevelScreenLock | data | |
| kSLSSpaceAbsoluteLevelShieldWindow | data | |
| kSLSUserAccessibilityReportSessionIDKey | data |