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
12d0792f
Commit
12d0792f
authored
Aug 16, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move display placement logic out of graphics drivers.
parent
8b737af6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
56 additions
and
76 deletions
+56
-76
driver.c
dlls/win32u/driver.c
+7
-7
sysparams.c
dlls/win32u/sysparams.c
+0
-0
init.c
dlls/wineandroid.drv/init.c
+4
-5
display.c
dlls/winemac.drv/display.c
+40
-57
gdi.c
dlls/winemac.drv/gdi.c
+1
-1
macdrv.h
dlls/winemac.drv/macdrv.h
+1
-2
display.c
dlls/winex11.drv/display.c
+0
-0
init.c
dlls/winex11.drv/init.c
+1
-1
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-2
gdi_driver.h
include/wine/gdi_driver.h
+1
-1
No files found.
dlls/win32u/driver.c
View file @
12d0792f
...
...
@@ -753,8 +753,8 @@ static void nulldrv_UpdateClipboard(void)
{
}
static
LONG
nulldrv_ChangeDisplaySettings
Ex
(
LPCWSTR
name
,
LPDEVMODEW
mode
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lparam
)
static
LONG
nulldrv_ChangeDisplaySettings
(
LPDEVMODEW
displays
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lparam
)
{
return
DISP_CHANGE_FAILED
;
}
...
...
@@ -1071,10 +1071,10 @@ static SHORT loaderdrv_VkKeyScanEx( WCHAR ch, HKL layout )
return
load_driver
()
->
pVkKeyScanEx
(
ch
,
layout
);
}
static
LONG
loaderdrv_ChangeDisplaySettings
Ex
(
LPCWSTR
name
,
LPDEVMODEW
mode
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lparam
)
static
LONG
loaderdrv_ChangeDisplaySettings
(
LPDEVMODEW
displays
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lparam
)
{
return
load_driver
()
->
pChangeDisplaySettings
Ex
(
name
,
mode
,
hwnd
,
flags
,
lparam
);
return
load_driver
()
->
pChangeDisplaySettings
(
displays
,
hwnd
,
flags
,
lparam
);
}
static
BOOL
loaderdrv_EnumDisplaySettingsEx
(
LPCWSTR
name
,
DWORD
num
,
LPDEVMODEW
mode
,
DWORD
flags
)
...
...
@@ -1187,7 +1187,7 @@ static const struct user_driver_funcs lazy_load_driver =
nulldrv_ClipboardWindowProc
,
loaderdrv_UpdateClipboard
,
/* display modes */
loaderdrv_ChangeDisplaySettings
Ex
,
loaderdrv_ChangeDisplaySettings
,
loaderdrv_EnumDisplaySettingsEx
,
loaderdrv_GetCurrentDisplaySettings
,
loaderdrv_UpdateDisplayDevices
,
...
...
@@ -1263,7 +1263,7 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version
SET_USER_FUNC
(
ClipCursor
);
SET_USER_FUNC
(
ClipboardWindowProc
);
SET_USER_FUNC
(
UpdateClipboard
);
SET_USER_FUNC
(
ChangeDisplaySettings
Ex
);
SET_USER_FUNC
(
ChangeDisplaySettings
);
SET_USER_FUNC
(
EnumDisplaySettingsEx
);
SET_USER_FUNC
(
GetCurrentDisplaySettings
);
SET_USER_FUNC
(
UpdateDisplayDevices
);
...
...
dlls/win32u/sysparams.c
View file @
12d0792f
This diff is collapsed.
Click to expand it.
dlls/wineandroid.drv/init.c
View file @
12d0792f
...
...
@@ -260,12 +260,11 @@ static BOOL CDECL ANDROID_DeleteDC( PHYSDEV dev )
/***********************************************************************
* ANDROID_ChangeDisplaySettings
Ex
* ANDROID_ChangeDisplaySettings
*/
LONG
ANDROID_ChangeDisplaySettingsEx
(
LPCWSTR
devname
,
LPDEVMODEW
devmode
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lpvoid
)
LONG
ANDROID_ChangeDisplaySettings
(
LPDEVMODEW
displays
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lpvoid
)
{
FIXME
(
"(%
s,%p,%p,0x%08x,%p)
\n
"
,
debugstr_w
(
devname
),
devmode
,
hwnd
,
flags
,
lpvoid
);
FIXME
(
"(%
p,%p,0x%08x,%p)
\n
"
,
displays
,
hwnd
,
flags
,
lpvoid
);
return
DISP_CHANGE_SUCCESSFUL
;
}
...
...
@@ -377,7 +376,7 @@ static const struct user_driver_funcs android_drv_funcs =
.
pMapVirtualKeyEx
=
ANDROID_MapVirtualKeyEx
,
.
pVkKeyScanEx
=
ANDROID_VkKeyScanEx
,
.
pSetCursor
=
ANDROID_SetCursor
,
.
pChangeDisplaySettings
Ex
=
ANDROID_ChangeDisplaySettingsEx
,
.
pChangeDisplaySettings
=
ANDROID_ChangeDisplaySettings
,
.
pEnumDisplaySettingsEx
=
ANDROID_EnumDisplaySettingsEx
,
.
pGetCurrentDisplaySettings
=
ANDROID_GetCurrentDisplaySettings
,
.
pUpdateDisplayDevices
=
ANDROID_UpdateDisplayDevices
,
...
...
dlls/winemac.drv/display.c
View file @
12d0792f
...
...
@@ -34,6 +34,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
display
);
#define NEXT_DEVMODEW(mode) ((DEVMODEW *)((char *)((mode) + 1) + (mode)->dmDriverExtra))
struct
display_mode_descriptor
{
...
...
@@ -769,84 +770,73 @@ static CGDisplayModeRef find_best_display_mode(DEVMODEW *devmode, CFArrayRef dis
}
/***********************************************************************
* ChangeDisplaySettings
Ex
(MACDRV.@)
* ChangeDisplaySettings (MACDRV.@)
*
*/
LONG
macdrv_ChangeDisplaySettingsEx
(
LPCWSTR
devname
,
LPDEVMODEW
devmode
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lpvoid
)
LONG
macdrv_ChangeDisplaySettings
(
LPDEVMODEW
displays
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lpvoid
)
{
WCHAR
primary_adapter
[
CCHDEVICENAME
];
LONG
ret
=
DISP_CHANGE_
BADMODE
;
DEVMODEW
default_
mode
;
LONG
ret
=
DISP_CHANGE_
SUCCESSFUL
;
DEVMODEW
*
mode
;
int
bpp
;
struct
macdrv_display
*
displays
;
struct
macdrv_display
*
macdrv_
displays
;
int
num_displays
;
CFArrayRef
display_modes
;
struct
display_mode_descriptor
*
desc
;
CGDisplayModeRef
best_display_mode
;
TRACE
(
"%
s %p %p 0x%08x %p
\n
"
,
debugstr_w
(
devname
),
devmode
,
hwnd
,
flags
,
lpvoid
);
TRACE
(
"%
p %p 0x%08x %p
\n
"
,
displays
,
hwnd
,
flags
,
lpvoid
);
init_original_display_mode
();
if
(
!
get_primary_adapter
(
primary_adapter
))
return
DISP_CHANGE_FAILED
;
if
(
!
devname
&&
!
devmode
)
{
UNICODE_STRING
str
;
memset
(
&
default_mode
,
0
,
sizeof
(
default_mode
));
default_mode
.
dmSize
=
sizeof
(
default_mode
);
RtlInitUnicodeString
(
&
str
,
primary_adapter
);
if
(
!
NtUserEnumDisplaySettings
(
&
str
,
ENUM_REGISTRY_SETTINGS
,
&
default_mode
,
0
))
{
ERR
(
"Default mode not found for %s!
\n
"
,
wine_dbgstr_w
(
primary_adapter
));
return
DISP_CHANGE_BADMODE
;
}
devname
=
primary_adapter
;
devmode
=
&
default_mode
;
}
else
if
(
wcsicmp
(
primary_adapter
,
devname
))
{
FIXME
(
"Changing non-primary adapter settings is currently unsupported.
\n
"
);
return
DISP_CHANGE_SUCCESSFUL
;
}
if
(
is_detached_mode
(
devmode
))
{
FIXME
(
"Detaching adapters is currently unsupported.
\n
"
);
return
DISP_CHANGE_SUCCESSFUL
;
}
if
(
macdrv_get_displays
(
&
displays
,
&
num_displays
))
if
(
macdrv_get_displays
(
&
macdrv_displays
,
&
num_displays
))
return
DISP_CHANGE_FAILED
;
display_modes
=
copy_display_modes
(
displays
[
0
].
displayID
,
FALSE
);
display_modes
=
copy_display_modes
(
macdrv_
displays
[
0
].
displayID
,
FALSE
);
if
(
!
display_modes
)
{
macdrv_free_displays
(
displays
);
macdrv_free_displays
(
macdrv_
displays
);
return
DISP_CHANGE_FAILED
;
}
pthread_mutex_lock
(
&
cached_modes_mutex
);
bpp
=
get_default_bpp
();
pthread_mutex_unlock
(
&
cached_modes_mutex
);
if
(
devmode
->
dmBitsPerPel
!=
bpp
)
TRACE
(
"using default %d bpp instead of caller's request %d bpp
\n
"
,
bpp
,
devmode
->
dmBitsPerPel
);
TRACE
(
"looking for %dx%dx%dbpp @%d Hz"
,
devmode
->
dmPelsWidth
,
devmode
->
dmPelsHeight
,
bpp
,
devmode
->
dmDisplayFrequency
);
TRACE
(
" %sstretched"
,
devmode
->
dmDisplayFixedOutput
==
DMDFO_STRETCH
?
""
:
"un"
);
TRACE
(
" %sinterlaced"
,
devmode
->
dmDisplayFlags
&
DM_INTERLACED
?
""
:
"non-"
);
TRACE
(
"
\n
"
);
desc
=
create_original_display_mode_descriptor
(
displays
[
0
].
displayID
);
best_display_mode
=
find_best_display_mode
(
devmode
,
display_modes
,
bpp
,
desc
);
desc
=
create_original_display_mode_descriptor
(
macdrv_displays
[
0
].
displayID
);
if
(
best_display_mode
)
for
(
mode
=
displays
;
mode
->
dmSize
&&
!
ret
;
mode
=
NEXT_DEVMODEW
(
mode
)
)
{
if
(
macdrv_set_display_mode
(
&
displays
[
0
],
best_display_mode
))
if
(
wcsicmp
(
primary_adapter
,
mode
->
dmDeviceName
))
{
FIXME
(
"Changing non-primary adapter settings is currently unsupported.
\n
"
);
continue
;
}
if
(
is_detached_mode
(
mode
))
{
FIXME
(
"Detaching adapters is currently unsupported.
\n
"
);
continue
;
}
if
(
mode
->
dmBitsPerPel
!=
bpp
)
TRACE
(
"using default %d bpp instead of caller's request %d bpp
\n
"
,
bpp
,
mode
->
dmBitsPerPel
);
TRACE
(
"looking for %dx%dx%dbpp @%d Hz"
,
mode
->
dmPelsWidth
,
mode
->
dmPelsHeight
,
bpp
,
mode
->
dmDisplayFrequency
);
TRACE
(
" %sstretched"
,
mode
->
dmDisplayFixedOutput
==
DMDFO_STRETCH
?
""
:
"un"
);
TRACE
(
" %sinterlaced"
,
mode
->
dmDisplayFlags
&
DM_INTERLACED
?
""
:
"non-"
);
TRACE
(
"
\n
"
);
if
(
!
(
best_display_mode
=
find_best_display_mode
(
mode
,
display_modes
,
bpp
,
desc
)))
{
ERR
(
"No matching mode found %ux%ux%d @%u!
\n
"
,
mode
->
dmPelsWidth
,
mode
->
dmPelsHeight
,
bpp
,
mode
->
dmDisplayFrequency
);
ret
=
DISP_CHANGE_BADMODE
;
}
else
if
(
macdrv_set_display_mode
(
&
macdrv_displays
[
0
],
best_display_mode
))
{
int
mode_bpp
=
display_mode_bits_per_pixel
(
best_display_mode
);
size_t
width
=
CGDisplayModeGetWidth
(
best_display_mode
);
...
...
@@ -862,7 +852,6 @@ LONG macdrv_ChangeDisplaySettingsEx(LPCWSTR devname, LPDEVMODEW devmode,
send_message
(
NtUserGetDesktopWindow
(),
WM_MACDRV_UPDATE_DESKTOP_RECT
,
mode_bpp
,
MAKELPARAM
(
width
,
height
));
ret
=
DISP_CHANGE_SUCCESSFUL
;
}
else
{
...
...
@@ -870,16 +859,10 @@ LONG macdrv_ChangeDisplaySettingsEx(LPCWSTR devname, LPDEVMODEW devmode,
ret
=
DISP_CHANGE_FAILED
;
}
}
else
{
/* no valid modes found */
ERR
(
"No matching mode found %ux%ux%d @%u!
\n
"
,
devmode
->
dmPelsWidth
,
devmode
->
dmPelsHeight
,
bpp
,
devmode
->
dmDisplayFrequency
);
}
free_display_mode_descriptor
(
desc
);
CFRelease
(
display_modes
);
macdrv_free_displays
(
displays
);
macdrv_free_displays
(
macdrv_
displays
);
return
ret
;
}
...
...
dlls/winemac.drv/gdi.c
View file @
12d0792f
...
...
@@ -268,7 +268,7 @@ static const struct user_driver_funcs macdrv_funcs =
.
pActivateKeyboardLayout
=
macdrv_ActivateKeyboardLayout
,
.
pBeep
=
macdrv_Beep
,
.
pChangeDisplaySettings
Ex
=
macdrv_ChangeDisplaySettingsEx
,
.
pChangeDisplaySettings
=
macdrv_ChangeDisplaySettings
,
.
pClipCursor
=
macdrv_ClipCursor
,
.
pClipboardWindowProc
=
macdrv_ClipboardWindowProc
,
.
pCreateDesktopWindow
=
macdrv_CreateDesktopWindow
,
...
...
dlls/winemac.drv/macdrv.h
View file @
12d0792f
...
...
@@ -123,8 +123,7 @@ static inline struct macdrv_thread_data *macdrv_thread_data(void)
extern
BOOL
macdrv_ActivateKeyboardLayout
(
HKL
hkl
,
UINT
flags
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_Beep
(
void
)
DECLSPEC_HIDDEN
;
extern
LONG
macdrv_ChangeDisplaySettingsEx
(
LPCWSTR
devname
,
LPDEVMODEW
devmode
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lpvoid
)
DECLSPEC_HIDDEN
;
extern
LONG
macdrv_ChangeDisplaySettings
(
LPDEVMODEW
displays
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lpvoid
)
DECLSPEC_HIDDEN
;
extern
BOOL
macdrv_EnumDisplaySettingsEx
(
LPCWSTR
devname
,
DWORD
mode
,
LPDEVMODEW
devmode
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
extern
BOOL
macdrv_GetCurrentDisplaySettings
(
LPCWSTR
name
,
LPDEVMODEW
devmode
)
DECLSPEC_HIDDEN
;
...
...
dlls/winex11.drv/display.c
View file @
12d0792f
This diff is collapsed.
Click to expand it.
dlls/winex11.drv/init.c
View file @
12d0792f
...
...
@@ -403,7 +403,7 @@ static const struct user_driver_funcs x11drv_funcs =
.
pGetCursorPos
=
X11DRV_GetCursorPos
,
.
pSetCursorPos
=
X11DRV_SetCursorPos
,
.
pClipCursor
=
X11DRV_ClipCursor
,
.
pChangeDisplaySettings
Ex
=
X11DRV_ChangeDisplaySettingsEx
,
.
pChangeDisplaySettings
=
X11DRV_ChangeDisplaySettings
,
.
pEnumDisplaySettingsEx
=
X11DRV_EnumDisplaySettingsEx
,
.
pGetCurrentDisplaySettings
=
X11DRV_GetCurrentDisplaySettings
,
.
pUpdateDisplayDevices
=
X11DRV_UpdateDisplayDevices
,
...
...
dlls/winex11.drv/x11drv.h
View file @
12d0792f
...
...
@@ -213,8 +213,7 @@ extern void X11DRV_SetCursor( HCURSOR handle ) DECLSPEC_HIDDEN;
extern
BOOL
X11DRV_SetCursorPos
(
INT
x
,
INT
y
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_GetCursorPos
(
LPPOINT
pos
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_ClipCursor
(
LPCRECT
clip
)
DECLSPEC_HIDDEN
;
extern
LONG
X11DRV_ChangeDisplaySettingsEx
(
LPCWSTR
devname
,
LPDEVMODEW
devmode
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lpvoid
)
DECLSPEC_HIDDEN
;
extern
LONG
X11DRV_ChangeDisplaySettings
(
LPDEVMODEW
displays
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lpvoid
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_EnumDisplaySettingsEx
(
LPCWSTR
name
,
DWORD
n
,
LPDEVMODEW
devmode
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_GetCurrentDisplaySettings
(
LPCWSTR
name
,
LPDEVMODEW
devmode
)
DECLSPEC_HIDDEN
;
...
...
include/wine/gdi_driver.h
View file @
12d0792f
...
...
@@ -295,7 +295,7 @@ struct user_driver_funcs
LRESULT
(
*
pClipboardWindowProc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
void
(
*
pUpdateClipboard
)(
void
);
/* display modes */
LONG
(
*
pChangeDisplaySettings
Ex
)(
LPCWSTR
,
LPDEVMODEW
,
HWND
,
DWORD
,
LPVOID
);
LONG
(
*
pChangeDisplaySettings
)(
LPDEVMODEW
,
HWND
,
DWORD
,
LPVOID
);
BOOL
(
*
pEnumDisplaySettingsEx
)(
LPCWSTR
,
DWORD
,
LPDEVMODEW
,
DWORD
);
BOOL
(
*
pGetCurrentDisplaySettings
)(
LPCWSTR
,
LPDEVMODEW
);
BOOL
(
*
pUpdateDisplayDevices
)(
const
struct
gdi_device_manager
*
,
BOOL
,
void
*
);
...
...
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