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
334a0719
Commit
334a0719
authored
Jul 25, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Jul 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x11drv: Number of fixes for ChangeDisplaySettingsEx with tests.
parent
1d04f826
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
4 deletions
+66
-4
monitor.c
dlls/user/tests/monitor.c
+50
-0
settings.c
dlls/winex11.drv/settings.c
+16
-4
No files found.
dlls/user/tests/monitor.c
View file @
334a0719
...
...
@@ -97,9 +97,59 @@ static void test_enumdisplaydevices(void)
}
}
struct
vid_mode
{
DWORD
w
,
h
,
bpp
,
freq
,
fields
;
LONG
res
;
};
static
struct
vid_mode
vid_modes_test
[]
=
{
{
640
,
480
,
0
,
0
,
DM_PELSWIDTH
|
DM_PELSHEIGHT
|
DM_BITSPERPEL
|
DM_DISPLAYFREQUENCY
,
DISP_CHANGE_SUCCESSFUL
},
{
640
,
480
,
0
,
0
,
DM_PELSWIDTH
|
DM_PELSHEIGHT
|
DM_DISPLAYFREQUENCY
,
DISP_CHANGE_SUCCESSFUL
},
{
640
,
480
,
0
,
0
,
DM_PELSWIDTH
|
DM_PELSHEIGHT
|
DM_BITSPERPEL
,
DISP_CHANGE_SUCCESSFUL
},
{
640
,
480
,
0
,
0
,
DM_PELSWIDTH
|
DM_PELSHEIGHT
,
DISP_CHANGE_SUCCESSFUL
},
{
640
,
480
,
0
,
0
,
DM_BITSPERPEL
,
DISP_CHANGE_SUCCESSFUL
},
{
640
,
480
,
0
,
0
,
DM_DISPLAYFREQUENCY
,
DISP_CHANGE_SUCCESSFUL
},
{
0
,
0
,
0
,
0
,
DM_PELSWIDTH
,
DISP_CHANGE_SUCCESSFUL
},
{
0
,
0
,
0
,
0
,
DM_PELSHEIGHT
,
DISP_CHANGE_SUCCESSFUL
},
{
640
,
480
,
0
,
0
,
DM_PELSWIDTH
,
DISP_CHANGE_BADMODE
},
{
640
,
480
,
0
,
0
,
DM_PELSHEIGHT
,
DISP_CHANGE_BADMODE
},
{
0
,
480
,
0
,
0
,
DM_PELSWIDTH
|
DM_PELSHEIGHT
,
DISP_CHANGE_BADMODE
},
{
640
,
0
,
0
,
0
,
DM_PELSWIDTH
|
DM_PELSHEIGHT
,
DISP_CHANGE_BADMODE
},
{
0
,
0
,
0
,
10
,
DM_DISPLAYFREQUENCY
,
DISP_CHANGE_BADMODE
},
};
#define vid_modes_cnt (sizeof(vid_modes_test) / sizeof(vid_modes_test[0]))
static
void
test_ChangeDisplaySettingsEx
(
void
)
{
DEVMODE
dm
;
LONG
res
;
int
i
;
memset
(
&
dm
,
0
,
sizeof
(
dm
));
dm
.
dmSize
=
sizeof
(
dm
);
for
(
i
=
0
;
i
<
vid_modes_cnt
;
i
++
)
{
dm
.
dmPelsWidth
=
vid_modes_test
[
i
].
w
;
dm
.
dmPelsHeight
=
vid_modes_test
[
i
].
h
;
dm
.
dmBitsPerPel
=
vid_modes_test
[
i
].
bpp
;
dm
.
dmDisplayFrequency
=
vid_modes_test
[
i
].
freq
;
dm
.
dmFields
=
vid_modes_test
[
i
].
fields
;
res
=
ChangeDisplaySettingsEx
(
NULL
,
&
dm
,
NULL
,
CDS_FULLSCREEN
,
NULL
);
ok
(
res
==
vid_modes_test
[
i
].
res
,
"Failed to change resolution[%d]: %ld
\n
"
,
i
,
res
);
}
res
=
ChangeDisplaySettingsEx
(
NULL
,
NULL
,
NULL
,
CDS_RESET
,
NULL
);
ok
(
res
==
DISP_CHANGE_SUCCESSFUL
,
"Failed to reset default resolution: %ld
\n
"
,
res
);
}
START_TEST
(
monitor
)
{
init_function_pointers
();
test_enumdisplaydevices
();
test_ChangeDisplaySettingsEx
();
}
dlls/winex11.drv/settings.c
View file @
334a0719
...
...
@@ -237,8 +237,9 @@ static const char * _DM_fields(DWORD fields)
LONG
X11DRV_ChangeDisplaySettingsEx
(
LPCWSTR
devname
,
LPDEVMODEW
devmode
,
HWND
hwnd
,
DWORD
flags
,
LPVOID
lpvoid
)
{
DWORD
i
,
dwBpp
;
DWORD
i
,
dwBpp
=
0
;
DEVMODEW
dm
;
BOOL
def_mode
=
TRUE
;
TRACE
(
"(%s,%p,%p,0x%08lx,%p)
\n
"
,
debugstr_w
(
devname
),
devmode
,
hwnd
,
flags
,
lpvoid
);
TRACE
(
"flags=%s
\n
"
,
_CDS_flags
(
flags
));
...
...
@@ -248,8 +249,15 @@ LONG X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode,
TRACE
(
"width=%ld height=%ld bpp=%ld freq=%ld (%s)
\n
"
,
devmode
->
dmPelsWidth
,
devmode
->
dmPelsHeight
,
devmode
->
dmBitsPerPel
,
devmode
->
dmDisplayFrequency
,
handler_name
);
dwBpp
=
(
devmode
->
dmBitsPerPel
==
24
)
?
32
:
devmode
->
dmBitsPerPel
;
if
(
devmode
->
dmFields
&
DM_BITSPERPEL
)
def_mode
&=
!
dwBpp
;
if
(
devmode
->
dmFields
&
DM_PELSWIDTH
)
def_mode
&=
!
devmode
->
dmPelsWidth
;
if
(
devmode
->
dmFields
&
DM_PELSHEIGHT
)
def_mode
&=
!
devmode
->
dmPelsHeight
;
if
(
devmode
->
dmFields
&
DM_DISPLAYFREQUENCY
)
def_mode
&=
!
devmode
->
dmDisplayFrequency
;
}
else
if
(
def_mode
)
{
TRACE
(
"Return to original display mode (%s)
\n
"
,
handler_name
);
if
(
!
X11DRV_EnumDisplaySettingsEx
(
devname
,
dd_mode_default
,
&
dm
,
0
))
...
...
@@ -259,7 +267,10 @@ LONG X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode,
}
devmode
=
&
dm
;
}
dwBpp
=
(
devmode
->
dmBitsPerPel
==
24
)
?
32
:
devmode
->
dmBitsPerPel
;
dwBpp
=
!
dwBpp
?
dd_modes
[
dd_mode_default
].
dwBPP
:
dwBpp
;
if
((
devmode
->
dmFields
&
(
DM_PELSWIDTH
|
DM_PELSHEIGHT
))
!=
(
DM_PELSWIDTH
|
DM_PELSHEIGHT
))
return
DISP_CHANGE_BADMODE
;
for
(
i
=
0
;
i
<
dd_mode_count
;
i
++
)
{
...
...
@@ -278,7 +289,8 @@ LONG X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode,
if
(
devmode
->
dmPelsHeight
!=
dd_modes
[
i
].
dwHeight
)
continue
;
}
if
((
devmode
->
dmFields
&
DM_DISPLAYFREQUENCY
)
&&
(
dd_modes
[
i
].
wRefreshRate
!=
0
))
if
((
devmode
->
dmFields
&
DM_DISPLAYFREQUENCY
)
&&
(
dd_modes
[
i
].
wRefreshRate
!=
0
)
&&
devmode
->
dmDisplayFrequency
!=
0
)
{
if
(
devmode
->
dmDisplayFrequency
!=
dd_modes
[
i
].
wRefreshRate
)
continue
;
...
...
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