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
f71c9628
Commit
f71c9628
authored
Oct 12, 2000
by
Marcus Meissner
Committed by
Alexandre Julliard
Oct 12, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable XF86vmode switching possible for X11 too.
parent
140d8cd9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
69 deletions
+99
-69
dga.c
dlls/ddraw/ddraw/dga.c
+4
-61
x11.c
dlls/ddraw/ddraw/x11.c
+87
-3
dga_private.h
dlls/ddraw/dga_private.h
+0
-5
x11_private.h
dlls/ddraw/x11_private.h
+8
-0
No files found.
dlls/ddraw/ddraw/dga.c
View file @
f71c9628
...
...
@@ -208,7 +208,6 @@ static HRESULT WINAPI DGA_IDirectDrawImpl_SetDisplayMode(
)
{
ICOM_THIS
(
IDirectDrawImpl
,
iface
);
DDPRIVATE
(
This
);
int
i
,
mode_count
;
TRACE
(
"(%p)->(%ld,%ld,%ld)
\n
"
,
This
,
width
,
height
,
depth
);
...
...
@@ -231,52 +230,7 @@ static HRESULT WINAPI DGA_IDirectDrawImpl_SetDisplayMode(
ddpriv
->
fb_height
=
height
;
_common_IDirectDrawImpl_SetDisplayMode
(
This
);
#ifdef HAVE_LIBXXF86VM
{
XF86VidModeModeInfo
**
all_modes
,
*
vidmode
=
NULL
;
XF86VidModeModeLine
mod_tmp
;
/* int dotclock_tmp; */
/* save original video mode and set fullscreen if available*/
orig_mode
=
(
XF86VidModeModeInfo
*
)
malloc
(
sizeof
(
XF86VidModeModeInfo
));
TSXF86VidModeGetModeLine
(
display
,
DefaultScreen
(
display
),
&
orig_mode
->
dotclock
,
&
mod_tmp
);
orig_mode
->
hdisplay
=
mod_tmp
.
hdisplay
;
orig_mode
->
hsyncstart
=
mod_tmp
.
hsyncstart
;
orig_mode
->
hsyncend
=
mod_tmp
.
hsyncend
;
orig_mode
->
htotal
=
mod_tmp
.
htotal
;
orig_mode
->
vdisplay
=
mod_tmp
.
vdisplay
;
orig_mode
->
vsyncstart
=
mod_tmp
.
vsyncstart
;
orig_mode
->
vsyncend
=
mod_tmp
.
vsyncend
;
orig_mode
->
vtotal
=
mod_tmp
.
vtotal
;
orig_mode
->
flags
=
mod_tmp
.
flags
;
orig_mode
->
private
=
mod_tmp
.
private
;
TSXF86VidModeGetAllModeLines
(
display
,
DefaultScreen
(
display
),
&
mode_count
,
&
all_modes
);
for
(
i
=
0
;
i
<
mode_count
;
i
++
)
{
if
(
all_modes
[
i
]
->
hdisplay
==
width
&&
all_modes
[
i
]
->
vdisplay
==
height
)
{
vidmode
=
(
XF86VidModeModeInfo
*
)
malloc
(
sizeof
(
XF86VidModeModeInfo
));
*
vidmode
=
*
(
all_modes
[
i
]);
break
;
}
else
TSXFree
(
all_modes
[
i
]
->
private
);
}
for
(
i
++
;
i
<
mode_count
;
i
++
)
TSXFree
(
all_modes
[
i
]
->
private
);
TSXFree
(
all_modes
);
if
(
!
vidmode
)
WARN
(
"Fullscreen mode not available!
\n
"
);
if
(
vidmode
)
{
TRACE
(
"SwitchToMode(%dx%d)
\n
"
,
vidmode
->
hdisplay
,
vidmode
->
vdisplay
);
TSXF86VidModeSwitchToMode
(
display
,
DefaultScreen
(
display
),
vidmode
);
#if 0 /* This messes up my screen (XF86_Mach64, 3.3.2.3a) for some reason, and should now be unnecessary */
TSXF86VidModeSetViewPort(display, DefaultScreen(display), 0, 0);
#endif
}
}
#endif
xf86vmode_setdisplaymode
(
width
,
height
);
/* FIXME: this function OVERWRITES several signal handlers.
* can we save them? and restore them later? In a way that
...
...
@@ -414,20 +368,9 @@ static ULONG WINAPI DGA_IDirectDraw2Impl_Release(LPDIRECTDRAW2 iface) {
TSXF86DGADirectVideo
(
display
,
DefaultScreen
(
display
),
0
);
if
(
This
->
d
->
window
&&
GetPropA
(
This
->
d
->
window
,
ddProp
))
DestroyWindow
(
This
->
d
->
window
);
#ifdef HAVE_LIBXXF86VM
if
(
orig_mode
)
{
TSXF86VidModeSwitchToMode
(
display
,
DefaultScreen
(
display
),
orig_mode
);
if
(
orig_mode
->
privsize
)
TSXFree
(
orig_mode
->
private
);
free
(
orig_mode
);
orig_mode
=
NULL
;
}
#endif
xf86vmode_restore
();
#ifdef RESTORE_SIGNALS
SIGNAL_Init
();
#endif
...
...
dlls/ddraw/ddraw/x11.c
View file @
f71c9628
...
...
@@ -148,6 +148,71 @@ clean_up_and_exit:
return
index
;
}
#ifdef HAVE_LIBXXF86VM
static
XF86VidModeModeInfo
*
orig_mode
=
NULL
;
void
xf86vmode_setdisplaymode
(
width
,
height
)
{
int
i
,
mode_count
;
XF86VidModeModeInfo
**
all_modes
,
*
vidmode
=
NULL
;
XF86VidModeModeLine
mod_tmp
;
/* int dotclock_tmp; */
/* save original video mode and set fullscreen if available*/
orig_mode
=
(
XF86VidModeModeInfo
*
)
malloc
(
sizeof
(
XF86VidModeModeInfo
));
TSXF86VidModeGetModeLine
(
display
,
DefaultScreen
(
display
),
&
orig_mode
->
dotclock
,
&
mod_tmp
);
orig_mode
->
hdisplay
=
mod_tmp
.
hdisplay
;
orig_mode
->
hsyncstart
=
mod_tmp
.
hsyncstart
;
orig_mode
->
hsyncend
=
mod_tmp
.
hsyncend
;
orig_mode
->
htotal
=
mod_tmp
.
htotal
;
orig_mode
->
vdisplay
=
mod_tmp
.
vdisplay
;
orig_mode
->
vsyncstart
=
mod_tmp
.
vsyncstart
;
orig_mode
->
vsyncend
=
mod_tmp
.
vsyncend
;
orig_mode
->
vtotal
=
mod_tmp
.
vtotal
;
orig_mode
->
flags
=
mod_tmp
.
flags
;
orig_mode
->
private
=
mod_tmp
.
private
;
TSXF86VidModeGetAllModeLines
(
display
,
DefaultScreen
(
display
),
&
mode_count
,
&
all_modes
);
for
(
i
=
0
;
i
<
mode_count
;
i
++
)
{
if
(
all_modes
[
i
]
->
hdisplay
==
width
&&
all_modes
[
i
]
->
vdisplay
==
height
)
{
vidmode
=
(
XF86VidModeModeInfo
*
)
malloc
(
sizeof
(
XF86VidModeModeInfo
));
*
vidmode
=
*
(
all_modes
[
i
]);
break
;
}
else
TSXFree
(
all_modes
[
i
]
->
private
);
}
for
(
i
++
;
i
<
mode_count
;
i
++
)
TSXFree
(
all_modes
[
i
]
->
private
);
TSXFree
(
all_modes
);
if
(
!
vidmode
)
WARN
(
"Fullscreen mode not available!
\n
"
);
if
(
vidmode
)
{
TRACE
(
"SwitchToMode(%dx%d)
\n
"
,
vidmode
->
hdisplay
,
vidmode
->
vdisplay
);
TSXF86VidModeSwitchToMode
(
display
,
DefaultScreen
(
display
),
vidmode
);
#if 0 /* This messes up my screen (XF86_Mach64, 3.3.2.3a) for some reason, and should now be unnecessary */
TSXF86VidModeSetViewPort(display, DefaultScreen(display), 0, 0);
#endif
}
}
void
xf86vmode_restore
()
{
if
(
!
orig_mode
)
return
;
TSXF86VidModeSwitchToMode
(
display
,
DefaultScreen
(
display
),
orig_mode
);
if
(
orig_mode
->
privsize
)
TSXFree
(
orig_mode
->
private
);
free
(
orig_mode
);
orig_mode
=
NULL
;
}
#else
void
xf86vmode_setdisplaymode
(
width
,
height
)
{}
void
xf86vmode_restore
()
{}
#endif
/*******************************************************************************
* IDirectDraw
*/
...
...
@@ -476,6 +541,23 @@ static XvImage *create_xvimage(IDirectDraw2Impl* This, IDirectDrawSurface4Impl*
}
#endif
ULONG
WINAPI
Xlib_IDirectDraw2Impl_Release
(
LPDIRECTDRAW2
iface
)
{
ICOM_THIS
(
IDirectDraw2Impl
,
iface
);
TRACE
(
"(%p)->() decrementing from %lu.
\n
"
,
This
,
This
->
ref
);
if
(
!--
(
This
->
ref
))
{
if
(
!--
(
This
->
d
->
ref
))
{
if
(
This
->
d
->
window
&&
GetPropA
(
This
->
d
->
window
,
ddProp
))
DestroyWindow
(
This
->
d
->
window
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
d
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
xf86vmode_restore
();
return
S_OK
;
}
return
This
->
ref
;
}
static
HRESULT
WINAPI
Xlib_IDirectDraw2Impl_CreateSurface
(
LPDIRECTDRAW2
iface
,
LPDDSURFACEDESC
lpddsd
,
LPDIRECTDRAWSURFACE
*
lpdsf
,
IUnknown
*
lpunk
...
...
@@ -679,6 +761,8 @@ static HRESULT WINAPI Xlib_IDirectDrawImpl_SetDisplayMode(
_common_IDirectDrawImpl_SetDisplayMode
(
This
);
xf86vmode_setdisplaymode
(
width
,
height
);
tmpWnd
=
WIN_FindWndPtr
(
This
->
d
->
window
);
This
->
d
->
paintable
=
1
;
ddpriv
->
drawable
=
((
X11DRV_WND_DATA
*
)
tmpWnd
->
pDriverData
)
->
window
;
...
...
@@ -1060,7 +1144,7 @@ ICOM_VTABLE(IDirectDraw) xlib_ddvt = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
XCAST
(
QueryInterface
)
Xlib_IDirectDraw2Impl_QueryInterface
,
XCAST
(
AddRef
)
IDirectDraw2Impl_AddRef
,
XCAST
(
Release
)
IDirectDraw2Impl_Release
,
XCAST
(
Release
)
Xlib_
IDirectDraw2Impl_Release
,
XCAST
(
Compact
)
IDirectDraw2Impl_Compact
,
XCAST
(
CreateClipper
)
IDirectDraw2Impl_CreateClipper
,
XCAST
(
CreatePalette
)
Xlib_IDirectDraw2Impl_CreatePalette
,
...
...
@@ -1111,7 +1195,7 @@ ICOM_VTABLE(IDirectDraw2) xlib_dd2vt = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
Xlib_IDirectDraw2Impl_QueryInterface
,
IDirectDraw2Impl_AddRef
,
IDirectDraw2Impl_Release
,
Xlib_
IDirectDraw2Impl_Release
,
IDirectDraw2Impl_Compact
,
IDirectDraw2Impl_CreateClipper
,
Xlib_IDirectDraw2Impl_CreatePalette
,
...
...
@@ -1145,7 +1229,7 @@ ICOM_VTABLE(IDirectDraw4) xlib_dd4vt = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
XCAST
(
QueryInterface
)
Xlib_IDirectDraw2Impl_QueryInterface
,
XCAST
(
AddRef
)
IDirectDraw2Impl_AddRef
,
XCAST
(
Release
)
IDirectDraw2Impl_Release
,
XCAST
(
Release
)
Xlib_
IDirectDraw2Impl_Release
,
XCAST
(
Compact
)
IDirectDraw2Impl_Compact
,
XCAST
(
CreateClipper
)
IDirectDraw2Impl_CreateClipper
,
XCAST
(
CreatePalette
)
Xlib_IDirectDraw2Impl_CreatePalette
,
...
...
dlls/ddraw/dga_private.h
View file @
f71c9628
...
...
@@ -6,11 +6,6 @@
#include "ts_xf86dga.h"
#ifdef HAVE_LIBXXF86VM
# include "ts_xf86vmode.h"
extern
XF86VidModeModeInfo
*
orig_mode
;
#endif
/* defined(HAVE_LIBXXF86VM) */
extern
ICOM_VTABLE
(
IDirectDrawSurface4
)
dga_dds4vt
;
extern
ICOM_VTABLE
(
IDirectDraw
)
dga_ddvt
;
extern
ICOM_VTABLE
(
IDirectDrawPalette
)
dga_ddpalvt
;
...
...
dlls/ddraw/x11_private.h
View file @
f71c9628
...
...
@@ -18,6 +18,14 @@
# include "ts_xshm.h"
#endif
/* defined(HAVE_LIBXXSHM) */
#ifdef HAVE_LIBXXF86VM
# include "ts_xf86vmode.h"
extern
XF86VidModeModeInfo
*
orig_mode
;
#endif
/* defined(HAVE_LIBXXF86VM) */
extern
void
xf86vmode_setdisplaymode
(
int
,
int
);
extern
void
xf86vmode_restore
();
#ifdef HAVE_XVIDEO
#include "ts_xvideo.h"
#else
...
...
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