Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
95daa45d
Commit
95daa45d
authored
Jan 28, 2013
by
C.W. Betts
Committed by
Alexandre Julliard
Mar 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Implement getting and setting screen saver state on OS X.
parent
a767ee99
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
1 deletion
+74
-1
Makefile.in
dlls/winemac.drv/Makefile.in
+1
-1
macdrv_main.c
dlls/winemac.drv/macdrv_main.c
+72
-0
winemac.drv.spec
dlls/winemac.drv/winemac.drv.spec
+1
-0
No files found.
dlls/winemac.drv/Makefile.in
View file @
95daa45d
MODULE
=
winemac.drv
IMPORTS
=
uuid user32 gdi32 advapi32
DELAYIMPORTS
=
ole32 shell32
EXTRALIBS
=
-framework
AppKit
-framework
Carbon
-framework
Security
-framework
OpenGL
EXTRALIBS
=
-framework
AppKit
-framework
Carbon
-framework
Security
-framework
OpenGL
-framework
IOKit
C_SRCS
=
\
clipboard.c
\
...
...
dlls/winemac.drv/macdrv_main.c
View file @
95daa45d
...
...
@@ -22,12 +22,20 @@
#include "config.h"
#include <Security/AuthSession.h>
#include <IOKit/pwr_mgt/IOPMLib.h>
#include "macdrv.h"
#include "winuser.h"
#include "wine/server.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
macdrv
);
#ifndef kIOPMAssertionTypePreventUserIdleDisplaySleep
#define kIOPMAssertionTypePreventUserIdleDisplaySleep CFSTR("PreventUserIdleDisplaySleep")
#endif
#ifndef kCFCoreFoundationVersionNumber10_7
#define kCFCoreFoundationVersionNumber10_7 635.00
#endif
DWORD
thread_data_tls_index
=
TLS_OUT_OF_INDEXES
;
...
...
@@ -206,3 +214,67 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
}
return
ret
;
}
/***********************************************************************
* SystemParametersInfo (MACDRV.@)
*/
BOOL
CDECL
macdrv_SystemParametersInfo
(
UINT
action
,
UINT
int_param
,
void
*
ptr_param
,
UINT
flags
)
{
switch
(
action
)
{
case
SPI_GETSCREENSAVEACTIVE
:
if
(
ptr_param
)
{
CFDictionaryRef
assertionStates
;
IOReturn
status
=
IOPMCopyAssertionsStatus
(
&
assertionStates
);
if
(
status
==
kIOReturnSuccess
)
{
CFNumberRef
count
=
CFDictionaryGetValue
(
assertionStates
,
kIOPMAssertionTypeNoDisplaySleep
);
CFNumberRef
count2
=
CFDictionaryGetValue
(
assertionStates
,
kIOPMAssertionTypePreventUserIdleDisplaySleep
);
long
longCount
=
0
,
longCount2
=
0
;
if
(
count
)
CFNumberGetValue
(
count
,
kCFNumberLongType
,
&
longCount
);
if
(
count2
)
CFNumberGetValue
(
count2
,
kCFNumberLongType
,
&
longCount2
);
*
(
BOOL
*
)
ptr_param
=
!
longCount
&&
!
longCount2
;
CFRelease
(
assertionStates
);
}
else
{
WARN
(
"Could not determine screen saver state, error code %d
\n
"
,
status
);
*
(
BOOL
*
)
ptr_param
=
TRUE
;
}
return
TRUE
;
}
break
;
case
SPI_SETSCREENSAVEACTIVE
:
{
static
IOPMAssertionID
powerAssertion
=
kIOPMNullAssertionID
;
if
(
int_param
)
{
if
(
powerAssertion
!=
kIOPMNullAssertionID
)
{
IOPMAssertionRelease
(
powerAssertion
);
powerAssertion
=
kIOPMNullAssertionID
;
}
}
else
if
(
powerAssertion
==
kIOPMNullAssertionID
)
{
CFStringRef
assertName
;
/*Are we running Lion or later?*/
if
(
kCFCoreFoundationVersionNumber
>=
kCFCoreFoundationVersionNumber10_7
)
assertName
=
kIOPMAssertionTypePreventUserIdleDisplaySleep
;
else
assertName
=
kIOPMAssertionTypeNoDisplaySleep
;
IOPMAssertionCreateWithName
(
assertName
,
kIOPMAssertionLevelOn
,
CFSTR
(
"Wine Process requesting no screen saver"
),
&
powerAssertion
);
}
}
break
;
}
return
FALSE
;
}
dlls/winemac.drv/winemac.drv.spec
View file @
95daa45d
...
...
@@ -46,6 +46,7 @@
@ cdecl WindowMessage(long long long long) macdrv_WindowMessage
@ cdecl WindowPosChanged(long long long ptr ptr ptr ptr ptr) macdrv_WindowPosChanged
@ cdecl WindowPosChanging(long long long ptr ptr ptr ptr) macdrv_WindowPosChanging
@ cdecl SystemParametersInfo(long long ptr long) macdrv_SystemParametersInfo
# System tray
@ cdecl wine_notify_icon(long ptr)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment