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
3e6aa432
Commit
3e6aa432
authored
Feb 22, 2007
by
Francois Gouget
Committed by
Alexandre Julliard
Feb 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Catch and report screen resolution change errors.
parent
f273bf1a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
22 deletions
+39
-22
desktop.c
dlls/winex11.drv/desktop.c
+5
-3
settings.c
dlls/winex11.drv/settings.c
+21
-11
x11drv.h
dlls/winex11.drv/x11drv.h
+4
-4
xrandr.c
dlls/winex11.drv/xrandr.c
+7
-3
xvidmode.c
dlls/winex11.drv/xvidmode.c
+2
-1
No files found.
dlls/winex11.drv/desktop.c
View file @
3e6aa432
...
@@ -117,16 +117,18 @@ static int X11DRV_desktop_GetCurrentMode(void)
...
@@ -117,16 +117,18 @@ static int X11DRV_desktop_GetCurrentMode(void)
return
0
;
return
0
;
}
}
static
void
X11DRV_desktop_SetCurrentMode
(
int
mode
)
static
LONG
X11DRV_desktop_SetCurrentMode
(
int
mode
)
{
{
DWORD
dwBpp
=
screen_depth
;
DWORD
dwBpp
=
screen_depth
;
if
(
dwBpp
==
24
)
dwBpp
=
32
;
if
(
dwBpp
==
24
)
dwBpp
=
32
;
TRACE
(
"Resizing Wine desktop window to %dx%d
\n
"
,
dd_modes
[
mode
].
dwWidth
,
dd_modes
[
mode
].
dwHeight
);
X11DRV_resize_desktop
(
dd_modes
[
mode
].
dwWidth
,
dd_modes
[
mode
].
dwHeight
);
if
(
dwBpp
!=
dd_modes
[
mode
].
dwBPP
)
if
(
dwBpp
!=
dd_modes
[
mode
].
dwBPP
)
{
{
FIXME
(
"Cannot change screen BPP from %d to %d
\n
"
,
dwBpp
,
dd_modes
[
mode
].
dwBPP
);
FIXME
(
"Cannot change screen BPP from %d to %d
\n
"
,
dwBpp
,
dd_modes
[
mode
].
dwBPP
);
return
DISP_CHANGE_BADMODE
;
}
}
TRACE
(
"Resizing Wine desktop window to %dx%d
\n
"
,
dd_modes
[
mode
].
dwWidth
,
dd_modes
[
mode
].
dwHeight
);
X11DRV_resize_desktop
(
dd_modes
[
mode
].
dwWidth
,
dd_modes
[
mode
].
dwHeight
);
return
DISP_CHANGE_SUCCESSFUL
;
}
}
/***********************************************************************
/***********************************************************************
...
...
dlls/winex11.drv/settings.c
View file @
3e6aa432
...
@@ -43,17 +43,17 @@ static const unsigned int depths[] = {8, 16, 32};
...
@@ -43,17 +43,17 @@ static const unsigned int depths[] = {8, 16, 32};
/* pointers to functions that actually do the hard stuff */
/* pointers to functions that actually do the hard stuff */
static
int
(
*
pGetCurrentMode
)(
void
);
static
int
(
*
pGetCurrentMode
)(
void
);
static
void
(
*
pSetCurrentMode
)(
int
mode
);
static
LONG
(
*
pSetCurrentMode
)(
int
mode
);
static
const
char
*
handler_name
;
static
const
char
*
handler_name
;
/*
/*
* Set the handlers for resolution changing functions
* Set the handlers for resolution changing functions
* and initialize the master list of modes
* and initialize the master list of modes
*/
*/
LPDDHALMODEINFO
X11DRV_Settings_SetHandlers
(
const
char
*
name
,
LPDDHALMODEINFO
X11DRV_Settings_SetHandlers
(
const
char
*
name
,
int
(
*
pNewGCM
)(
void
),
int
(
*
pNewGCM
)(
void
),
void
(
*
pNewSCM
)(
int
),
LONG
(
*
pNewSCM
)(
int
),
unsigned
int
nmodes
,
unsigned
int
nmodes
,
int
reserve_depths
)
int
reserve_depths
)
{
{
handler_name
=
name
;
handler_name
=
name
;
...
@@ -144,9 +144,10 @@ static int X11DRV_nores_GetCurrentMode(void)
...
@@ -144,9 +144,10 @@ static int X11DRV_nores_GetCurrentMode(void)
{
{
return
0
;
return
0
;
}
}
static
void
X11DRV_nores_SetCurrentMode
(
int
mode
)
static
LONG
X11DRV_nores_SetCurrentMode
(
int
mode
)
{
{
TRACE
(
"Ignoring mode change request
\n
"
);
TRACE
(
"Ignoring mode change request
\n
"
);
return
DISP_CHANGE_FAILED
;
}
}
/* default handler only gets the current X desktop resolution */
/* default handler only gets the current X desktop resolution */
void
X11DRV_Settings_Init
(
void
)
void
X11DRV_Settings_Init
(
void
)
...
@@ -297,7 +298,7 @@ LONG X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode,
...
@@ -297,7 +298,7 @@ LONG X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode,
/* we have a valid mode */
/* we have a valid mode */
TRACE
(
"Requested display settings match mode %d (%s)
\n
"
,
i
,
handler_name
);
TRACE
(
"Requested display settings match mode %d (%s)
\n
"
,
i
,
handler_name
);
if
(
!
(
flags
&
CDS_TEST
))
if
(
!
(
flags
&
CDS_TEST
))
pSetCurrentMode
(
i
);
return
pSetCurrentMode
(
i
);
return
DISP_CHANGE_SUCCESSFUL
;
return
DISP_CHANGE_SUCCESSFUL
;
}
}
...
@@ -316,9 +317,18 @@ LONG X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode,
...
@@ -316,9 +317,18 @@ LONG X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode,
static
DWORD
PASCAL
X11DRV_Settings_SetMode
(
LPDDHAL_SETMODEDATA
data
)
static
DWORD
PASCAL
X11DRV_Settings_SetMode
(
LPDDHAL_SETMODEDATA
data
)
{
{
TRACE
(
"Mode %d requested by DDHAL (%s)
\n
"
,
data
->
dwModeIndex
,
handler_name
);
TRACE
(
"Mode %d requested by DDHAL (%s)
\n
"
,
data
->
dwModeIndex
,
handler_name
);
pSetCurrentMode
(
data
->
dwModeIndex
);
switch
(
pSetCurrentMode
(
data
->
dwModeIndex
))
X11DRV_DDHAL_SwitchMode
(
data
->
dwModeIndex
,
NULL
,
NULL
);
{
data
->
ddRVal
=
DD_OK
;
case
DISP_CHANGE_SUCCESSFUL
:
X11DRV_DDHAL_SwitchMode
(
data
->
dwModeIndex
,
NULL
,
NULL
);
data
->
ddRVal
=
DD_OK
;
break
;
case
DISP_CHANGE_BADMODE
:
data
->
ddRVal
=
DDERR_WRONGMODE
;
break
;
default:
data
->
ddRVal
=
DDERR_UNSUPPORTEDMODE
;
}
return
DDHAL_DRIVER_HANDLED
;
return
DDHAL_DRIVER_HANDLED
;
}
}
int
X11DRV_Settings_CreateDriver
(
LPDDHALINFO
info
)
int
X11DRV_Settings_CreateDriver
(
LPDDHALINFO
info
)
...
...
dlls/winex11.drv/x11drv.h
View file @
3e6aa432
...
@@ -699,10 +699,10 @@ extern LPDDHALMODEINFO X11DRV_Settings_CreateModes(unsigned int max_modes, int r
...
@@ -699,10 +699,10 @@ extern LPDDHALMODEINFO X11DRV_Settings_CreateModes(unsigned int max_modes, int r
unsigned
int
X11DRV_Settings_GetModeCount
(
void
);
unsigned
int
X11DRV_Settings_GetModeCount
(
void
);
void
X11DRV_Settings_Init
(
void
);
void
X11DRV_Settings_Init
(
void
);
extern
void
X11DRV_Settings_SetDefaultMode
(
int
mode
);
extern
void
X11DRV_Settings_SetDefaultMode
(
int
mode
);
LPDDHALMODEINFO
X11DRV_Settings_SetHandlers
(
const
char
*
name
,
LPDDHALMODEINFO
X11DRV_Settings_SetHandlers
(
const
char
*
name
,
int
(
*
pNewGCM
)(
void
),
int
(
*
pNewGCM
)(
void
),
void
(
*
pNewSCM
)(
int
),
LONG
(
*
pNewSCM
)(
int
),
unsigned
int
nmodes
,
unsigned
int
nmodes
,
int
reserve_depths
);
int
reserve_depths
);
extern
void
X11DRV_DDHAL_SwitchMode
(
DWORD
dwModeIndex
,
LPVOID
fb_addr
,
LPVIDMEM
fb_mem
);
extern
void
X11DRV_DDHAL_SwitchMode
(
DWORD
dwModeIndex
,
LPVOID
fb_addr
,
LPVIDMEM
fb_mem
);
...
...
dlls/winex11.drv/xrandr.c
View file @
3e6aa432
...
@@ -182,7 +182,7 @@ static int X11DRV_XRandR_GetCurrentMode(void)
...
@@ -182,7 +182,7 @@ static int X11DRV_XRandR_GetCurrentMode(void)
return
res
;
return
res
;
}
}
static
void
X11DRV_XRandR_SetCurrentMode
(
int
mode
)
static
LONG
X11DRV_XRandR_SetCurrentMode
(
int
mode
)
{
{
SizeID
size
;
SizeID
size
;
Rotation
rot
;
Rotation
rot
;
...
@@ -243,9 +243,13 @@ static void X11DRV_XRandR_SetCurrentMode(int mode)
...
@@ -243,9 +243,13 @@ static void X11DRV_XRandR_SetCurrentMode(int mode)
pXRRFreeScreenConfigInfo
(
sc
);
pXRRFreeScreenConfigInfo
(
sc
);
wine_tsx11_unlock
();
wine_tsx11_unlock
();
if
(
stat
==
RRSetConfigSuccess
)
if
(
stat
==
RRSetConfigSuccess
)
{
X11DRV_handle_desktop_resize
(
dd_modes
[
mode
].
dwWidth
,
dd_modes
[
mode
].
dwHeight
);
X11DRV_handle_desktop_resize
(
dd_modes
[
mode
].
dwWidth
,
dd_modes
[
mode
].
dwHeight
);
else
return
DISP_CHANGE_SUCCESSFUL
;
ERR
(
"Resolution change not successful -- perhaps display has changed?
\n
"
);
}
ERR
(
"Resolution change not successful -- perhaps display has changed?
\n
"
);
return
DISP_CHANGE_FAILED
;
}
}
void
X11DRV_XRandR_Init
(
void
)
void
X11DRV_XRandR_Init
(
void
)
...
...
dlls/winex11.drv/xvidmode.c
View file @
3e6aa432
...
@@ -111,7 +111,7 @@ static int X11DRV_XF86VM_GetCurrentMode(void)
...
@@ -111,7 +111,7 @@ static int X11DRV_XF86VM_GetCurrentMode(void)
return
0
;
return
0
;
}
}
static
void
X11DRV_XF86VM_SetCurrentMode
(
int
mode
)
static
LONG
X11DRV_XF86VM_SetCurrentMode
(
int
mode
)
{
{
DWORD
dwBpp
=
screen_depth
;
DWORD
dwBpp
=
screen_depth
;
if
(
dwBpp
==
24
)
dwBpp
=
32
;
if
(
dwBpp
==
24
)
dwBpp
=
32
;
...
@@ -135,6 +135,7 @@ static void X11DRV_XF86VM_SetCurrentMode(int mode)
...
@@ -135,6 +135,7 @@ static void X11DRV_XF86VM_SetCurrentMode(int mode)
wine_tsx11_unlock
();
wine_tsx11_unlock
();
X11DRV_handle_desktop_resize
(
real_xf86vm_modes
[
mode
]
->
hdisplay
,
X11DRV_handle_desktop_resize
(
real_xf86vm_modes
[
mode
]
->
hdisplay
,
real_xf86vm_modes
[
mode
]
->
vdisplay
);
real_xf86vm_modes
[
mode
]
->
vdisplay
);
return
DISP_CHANGE_SUCCESSFUL
;
}
}
void
X11DRV_XF86VM_Init
(
void
)
void
X11DRV_XF86VM_Init
(
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