2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
5 Desc: Enable fullscreen mode.
9 #include <aros/config.h>
10 #include "x11_types.h"
14 #define __typedef_BYTE
15 #define __typedef_BOOL
16 typedef unsigned char UBYTE
;
18 #include <X11/extensions/xf86vmode.h>
21 #define HAVE_XF86VMODE_H
23 #include "x11_hostlib.h"
25 static XF86VidModeModeInfo
**videomodes
;
26 static int num_videomodes
;
28 int x11_fullscreen_supported(Display
*display
)
30 int majorversion
, minorversion
;
31 int eventbase
, errorbase
;
33 if (!XVMCALL(XF86VidModeQueryVersion
, display
, &majorversion
, &minorversion
))
38 if (!XVMCALL(XF86VidModeQueryExtension
, display
, &eventbase
, &errorbase
))
43 if (XVMCALL(XF86VidModeGetAllModeLines
, display
, DefaultScreen(display
), &num_videomodes
, &videomodes
))
45 if (num_videomodes
>= 2) return 1;
51 void x11_fullscreen_switchmode(Display
*display
, int *w
, int *h
)
55 if (videomodes
== NULL
)
58 for(i
= 1, mode
= 0; i
< num_videomodes
; i
++)
60 if ((videomodes
[i
]->hdisplay
>= *w
) &&
61 (videomodes
[i
]->vdisplay
>= *h
) &&
62 (videomodes
[i
]->hdisplay
< videomodes
[mode
]->hdisplay
) &&
63 (videomodes
[i
]->vdisplay
< videomodes
[mode
]->vdisplay
))
69 *w
= videomodes
[mode
]->hdisplay
;
70 *h
= videomodes
[mode
]->vdisplay
;
72 XVMCALL(XF86VidModeSwitchToMode
, display
, DefaultScreen(display
), videomodes
[mode
]);
73 XVMCALL(XF86VidModeSetViewPort
, display
, DefaultScreen(display
), 0, 0);
76 #else /* if USE_VIDMODE */
78 int x11_fullscreen_supported(Display
*display
)
83 void x11_fullscreen_switchmode(Display
*display
, int *w
, int *h
)