Mercurial > mplayer.hg
annotate libvo/x11_common.c @ 4686:b49325176f0d
fixed broken xvid support ("lm" rather than "-lm" in libs)
author | rfelker |
---|---|
date | Wed, 13 Feb 2002 03:14:45 +0000 |
parents | 93d562ad1c22 |
children | a34682347090 |
rev | line source |
---|---|
448
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
440
diff
changeset
|
1 |
32 | 2 #include <stdio.h> |
3 #include <stdlib.h> | |
448
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
440
diff
changeset
|
4 |
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
440
diff
changeset
|
5 #include "config.h" |
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
440
diff
changeset
|
6 |
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
440
diff
changeset
|
7 #ifdef X11_FULLSCREEN |
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
440
diff
changeset
|
8 |
440
d19a3da6ac13
Pontscho's mixer, select, and hell-a-lot-of-stuff patch ;)
gabucino
parents:
416
diff
changeset
|
9 #include <string.h> |
32 | 10 #include <unistd.h> |
11 #include <sys/mman.h> | |
12 | |
13 #include "video_out.h" | |
14 | |
324 | 15 #include <X11/Xmd.h> |
32 | 16 #include <X11/Xlib.h> |
17 #include <X11/Xutil.h> | |
18 #include <X11/Xatom.h> | |
19 | |
1345
be674b95b485
x11_common does not compile, when the XDPMS extension is not available on the
jkeil
parents:
1266
diff
changeset
|
20 #ifdef HAVE_XDPMS |
448
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
440
diff
changeset
|
21 #include <X11/extensions/dpms.h> |
1345
be674b95b485
x11_common does not compile, when the XDPMS extension is not available on the
jkeil
parents:
1266
diff
changeset
|
22 #endif |
448
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
440
diff
changeset
|
23 |
2149
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
24 #ifdef HAVE_XINERAMA |
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
25 #include <X11/extensions/Xinerama.h> |
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
26 #endif |
1732 | 27 |
4425
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
28 #ifdef HAVE_XF86VM |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
29 #include <X11/extensions/xf86vmode.h> |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
30 #endif |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
31 |
4658 | 32 #ifdef HAVE_NEW_INPUT |
33 #include "../input/input.h" | |
34 #include "../input/mouse.h" | |
35 #endif | |
36 | |
1732 | 37 /* |
38 * If SCAN_VISUALS is defined, vo_init() scans all available TrueColor | |
39 * visuals for the 'best' visual for MPlayer video display. Note that | |
40 * the 'best' visual might be different from the default visual that | |
41 * is in use on the root window of the display/screen. | |
42 */ | |
43 #define SCAN_VISUALS | |
44 | |
45 | |
1456
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1447
diff
changeset
|
46 extern verbose; |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1447
diff
changeset
|
47 |
324 | 48 static int dpms_disabled=0; |
49 static int timeout_save=0; | |
50 | |
922
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
51 char* mDisplayName=NULL; |
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
52 Display* mDisplay; |
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
53 Window mRootWin; |
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
54 int mScreen; |
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
55 int mLocalDisplay; |
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
56 |
3830 | 57 /* output window id */ |
58 int WinID=-1; | |
384 | 59 |
4017 | 60 #ifdef HAVE_XINERAMA |
61 int xinerama_screen = 0; | |
62 int xinerama_x = 0; | |
63 int xinerama_y = 0; | |
64 #endif | |
65 | |
4425
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
66 #ifdef HAVE_XF86VM |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
67 XF86VidModeModeInfo **vidmodes=NULL; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
68 #endif |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
69 |
384 | 70 void vo_hidecursor ( Display *disp , Window win ) |
71 { | |
458
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
72 Cursor no_ptr; |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
73 Pixmap bm_no; |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
74 XColor black,dummy; |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
75 Colormap colormap; |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
76 static unsigned char bm_no_data[] = { 0,0,0,0, 0,0,0,0 }; |
3954 | 77 |
78 if(WinID==0) return; // do not hide, if we're playing at rootwin | |
458
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
79 |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
80 colormap = DefaultColormap(disp,DefaultScreen(disp)); |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
81 XAllocNamedColor(disp,colormap,"black",&black,&dummy); |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
82 bm_no = XCreateBitmapFromData(disp, win, bm_no_data, 8,8); |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
83 no_ptr=XCreatePixmapCursor(disp, bm_no, bm_no,&black, &black,0, 0); |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
84 XDefineCursor(disp,win,no_ptr); |
384 | 85 } |
86 | |
87 | |
1732 | 88 #ifdef SCAN_VISUALS |
89 /* | |
90 * Scan the available visuals on this Display/Screen. Try to find | |
91 * the 'best' available TrueColor visual that has a decent color | |
92 * depth (at least 15bit). If there are multiple visuals with depth | |
93 * >= 15bit, we prefer visuals with a smaller color depth. | |
94 */ | |
95 int vo_find_depth_from_visuals(Display *dpy, int screen, Visual **visual_return) | |
96 { | |
97 XVisualInfo visual_tmpl; | |
98 XVisualInfo *visuals; | |
99 int nvisuals, i; | |
100 int bestvisual = -1; | |
101 int bestvisual_depth = -1; | |
102 | |
103 visual_tmpl.screen = screen; | |
104 visual_tmpl.class = TrueColor; | |
105 visuals = XGetVisualInfo(dpy, | |
106 VisualScreenMask | VisualClassMask, &visual_tmpl, | |
107 &nvisuals); | |
108 if (visuals != NULL) { | |
109 for (i = 0; i < nvisuals; i++) { | |
110 if (verbose) | |
111 printf("vo: X11 truecolor visual %#x, depth %d, R:%lX G:%lX B:%lX\n", | |
112 visuals[i].visualid, visuals[i].depth, | |
113 visuals[i].red_mask, visuals[i].green_mask, | |
114 visuals[i].blue_mask); | |
115 /* | |
116 * save the visual index and it's depth, if this is the first | |
117 * truecolor visul, or a visual that is 'preferred' over the | |
118 * previous 'best' visual | |
119 */ | |
120 if (bestvisual_depth == -1 | |
121 || (visuals[i].depth >= 15 | |
122 && ( visuals[i].depth < bestvisual_depth | |
123 || bestvisual_depth < 15))) { | |
124 bestvisual = i; | |
125 bestvisual_depth = visuals[i].depth; | |
126 } | |
127 } | |
128 | |
129 if (bestvisual != -1 && visual_return != NULL) | |
130 *visual_return = visuals[bestvisual].visual; | |
131 | |
132 XFree(visuals); | |
133 } | |
134 return bestvisual_depth; | |
135 } | |
136 #endif | |
137 | |
138 | |
32 | 139 int vo_init( void ) |
140 { | |
922
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
141 // int mScreen; |
1732 | 142 int depth, bpp; |
1137
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
143 unsigned int mask; |
922
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
144 // char * DisplayName = ":0.0"; |
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
145 // Display * mDisplay; |
1732 | 146 XImage * mXImage = NULL; |
922
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
147 // Window mRootWin; |
1732 | 148 XWindowAttributes attribs; |
32 | 149 |
150 if(vo_depthonscreen) return 1; // already called | |
151 | |
922
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
152 if (!mDisplayName) |
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
153 if (!(mDisplayName=getenv("DISPLAY"))) |
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
154 mDisplayName=strdup(":0.0"); |
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
155 |
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
156 mDisplay=XOpenDisplay(mDisplayName); |
32 | 157 if ( !mDisplay ) |
158 { | |
922
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
159 printf( "vo: couldn't open the X11 display (%s)!\n",mDisplayName ); |
32 | 160 return 0; |
161 } | |
162 mScreen=DefaultScreen( mDisplay ); // Screen ID. | |
163 mRootWin=RootWindow( mDisplay,mScreen );// Root window ID. | |
2149
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
164 |
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
165 #ifdef HAVE_XINERAMA |
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
166 if(XineramaIsActive(mDisplay)) |
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
167 { |
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
168 XineramaScreenInfo *screens; |
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
169 int num_screens; |
3990 | 170 |
2149
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
171 screens = XineramaQueryScreens(mDisplay, &num_screens); |
4017 | 172 if(xinerama_screen >= num_screens) xinerama_screen = 0; |
3461
6b4ff1eb79bf
xinerama: allow to override xinerama screen_w/screen_h and setting size of screen where the window is placed
alex
parents:
2364
diff
changeset
|
173 if (! vo_screenwidth) |
4017 | 174 vo_screenwidth=screens[xinerama_screen].width; |
3461
6b4ff1eb79bf
xinerama: allow to override xinerama screen_w/screen_h and setting size of screen where the window is placed
alex
parents:
2364
diff
changeset
|
175 if (! vo_screenheight) |
4017 | 176 vo_screenheight=screens[xinerama_screen].height; |
177 xinerama_x = screens[xinerama_screen].x_org; | |
178 xinerama_y = screens[xinerama_screen].y_org; | |
179 | |
3990 | 180 XFree(screens); |
2149
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
181 } |
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
182 else |
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
183 #endif |
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
184 { |
2364 | 185 if (! vo_screenwidth) |
186 vo_screenwidth=DisplayWidth( mDisplay,mScreen ); | |
187 if (! vo_screenheight) | |
188 vo_screenheight=DisplayHeight( mDisplay,mScreen ); | |
2149
6358db6ad3d0
Xinerama screen size fix by Lev Babiev <harley@hosers.org>
arpi
parents:
1746
diff
changeset
|
189 } |
1732 | 190 // get color depth (from root window, or the best visual): |
32 | 191 XGetWindowAttributes(mDisplay, mRootWin, &attribs); |
1732 | 192 depth=attribs.depth; |
193 | |
194 #ifdef SCAN_VISUALS | |
195 if (depth != 15 && depth != 16 && depth != 24 && depth != 32) { | |
196 Visual *visual; | |
197 | |
198 depth = vo_find_depth_from_visuals(mDisplay, mScreen, &visual); | |
199 if (depth != -1) | |
200 mXImage=XCreateImage(mDisplay, visual, depth, ZPixmap, | |
201 0, NULL, 1, 1, 8, 1); | |
202 } else | |
203 #endif | |
204 mXImage=XGetImage( mDisplay,mRootWin,0,0,1,1,AllPlanes,ZPixmap ); | |
205 | |
206 vo_depthonscreen = depth; // display depth on screen | |
207 | |
208 // get bits/pixel from XImage structure: | |
209 if (mXImage == NULL) { | |
210 mask = 0; | |
211 } else { | |
212 /* | |
213 * for the depth==24 case, the XImage structures might use | |
214 * 24 or 32 bits of data per pixel. The global variable | |
215 * vo_depthonscreen stores the amount of data per pixel in the | |
216 * XImage structure! | |
217 * | |
218 * Maybe we should rename vo_depthonscreen to (or add) vo_bpp? | |
219 */ | |
32 | 220 bpp=mXImage->bits_per_pixel; |
1137
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
221 if((vo_depthonscreen+7)/8 != (bpp+7)/8) vo_depthonscreen=bpp; // by A'rpi |
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
222 mask=mXImage->red_mask|mXImage->green_mask|mXImage->blue_mask; |
1456
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1447
diff
changeset
|
223 if(verbose) |
1732 | 224 printf("vo: X11 color mask: %X (R:%lX G:%lX B:%lX)\n", |
225 mask,mXImage->red_mask,mXImage->green_mask,mXImage->blue_mask); | |
4181 | 226 XDestroyImage( mXImage ); |
1732 | 227 } |
228 if(((vo_depthonscreen+7)/8)==2){ | |
229 if(mask==0x7FFF) vo_depthonscreen=15; else | |
230 if(mask==0xFFFF) vo_depthonscreen=16; | |
231 } | |
922
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
232 // XCloseDisplay( mDisplay ); |
1447
e82fbd67ae60
better local display connection patch by Adam Tla/lka atlka@pg.gda.pl
arpi
parents:
1415
diff
changeset
|
233 /* slightly improved local display detection AST */ |
e82fbd67ae60
better local display connection patch by Adam Tla/lka atlka@pg.gda.pl
arpi
parents:
1415
diff
changeset
|
234 if ( strncmp(mDisplayName, "unix:", 5) == 0) |
e82fbd67ae60
better local display connection patch by Adam Tla/lka atlka@pg.gda.pl
arpi
parents:
1415
diff
changeset
|
235 mDisplayName += 4; |
e82fbd67ae60
better local display connection patch by Adam Tla/lka atlka@pg.gda.pl
arpi
parents:
1415
diff
changeset
|
236 else if ( strncmp(mDisplayName, "localhost:", 10) == 0) |
e82fbd67ae60
better local display connection patch by Adam Tla/lka atlka@pg.gda.pl
arpi
parents:
1415
diff
changeset
|
237 mDisplayName += 9; |
922
db06ae8967eb
Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents:
741
diff
changeset
|
238 if (*mDisplayName==':') mLocalDisplay=1; else mLocalDisplay=0; |
1732 | 239 printf("vo: X11 running at %dx%d with depth %d and %d bits/pixel (\"%s\" => %s display)\n", |
240 vo_screenwidth,vo_screenheight, | |
241 depth, vo_depthonscreen, | |
242 mDisplayName,mLocalDisplay?"local":"remote"); | |
32 | 243 return 1; |
244 } | |
245 | |
4436 | 246 |
32 | 247 #include "../linux/keycodes.h" |
248 #include "wskeys.h" | |
249 | |
250 extern void mplayer_put_key(int code); | |
251 | |
252 void vo_x11_putkey(int key){ | |
253 switch ( key ) | |
254 { | |
255 case wsLeft: mplayer_put_key(KEY_LEFT); break; | |
256 case wsRight: mplayer_put_key(KEY_RIGHT); break; | |
257 case wsUp: mplayer_put_key(KEY_UP); break; | |
258 case wsDown: mplayer_put_key(KEY_DOWN); break; | |
259 case wsSpace: mplayer_put_key(' '); break; | |
260 case wsEscape: mplayer_put_key(KEY_ESC); break; | |
261 case wsEnter: mplayer_put_key(KEY_ENTER); break; | |
651 | 262 case wsPageUp: mplayer_put_key(KEY_PAGE_UP); break; |
263 case wsPageDown: mplayer_put_key(KEY_PAGE_DOWN); break; | |
32 | 264 case wsq: |
265 case wsQ: mplayer_put_key('q'); break; | |
266 case wsp: | |
267 case wsP: mplayer_put_key('p'); break; | |
268 case wsMinus: | |
269 case wsGrayMinus: mplayer_put_key('-'); break; | |
270 case wsPlus: | |
271 case wsGrayPlus: mplayer_put_key('+'); break; | |
464 | 272 case wsGrayMul: |
273 case wsMul: mplayer_put_key('*'); break; | |
274 case wsGrayDiv: | |
275 case wsDiv: mplayer_put_key('/'); break; | |
3490 | 276 case wsLess: mplayer_put_key('<'); break; |
277 case wsMore: mplayer_put_key('>'); break; | |
516 | 278 case wsm: |
279 case wsM: mplayer_put_key('m'); break; | |
655 | 280 case wso: |
281 case wsO: mplayer_put_key('o'); break; | |
1501
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1456
diff
changeset
|
282 default: if((key>='a' && key<='z')||(key>='A' && key<='Z')|| |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1456
diff
changeset
|
283 (key>='0' && key<='9')) mplayer_put_key(key); |
32 | 284 } |
369 | 285 |
32 | 286 } |
287 | |
288 | |
289 // ----- Motif header: ------- | |
290 | |
1236 | 291 #define MWM_HINTS_FUNCTIONS (1L << 0) |
292 #define MWM_HINTS_DECORATIONS (1L << 1) | |
293 #define MWM_HINTS_INPUT_MODE (1L << 2) | |
294 #define MWM_HINTS_STATUS (1L << 3) | |
295 | |
296 #define MWM_FUNC_ALL (1L << 0) | |
297 #define MWM_FUNC_RESIZE (1L << 1) | |
298 #define MWM_FUNC_MOVE (1L << 2) | |
299 #define MWM_FUNC_MINIMIZE (1L << 3) | |
300 #define MWM_FUNC_MAXIMIZE (1L << 4) | |
301 #define MWM_FUNC_CLOSE (1L << 5) | |
302 | |
303 #define MWM_DECOR_ALL (1L << 0) | |
304 #define MWM_DECOR_BORDER (1L << 1) | |
305 #define MWM_DECOR_RESIZEH (1L << 2) | |
306 #define MWM_DECOR_TITLE (1L << 3) | |
307 #define MWM_DECOR_MENU (1L << 4) | |
308 #define MWM_DECOR_MINIMIZE (1L << 5) | |
309 #define MWM_DECOR_MAXIMIZE (1L << 6) | |
310 | |
311 #define MWM_INPUT_MODELESS 0 | |
312 #define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1 | |
313 #define MWM_INPUT_SYSTEM_MODAL 2 | |
314 #define MWM_INPUT_FULL_APPLICATION_MODAL 3 | |
315 #define MWM_INPUT_APPLICATION_MODAL MWM_INPUT_PRIMARY_APPLICATION_MODAL | |
316 | |
317 #define MWM_TEAROFF_WINDOW (1L<<0) | |
32 | 318 |
319 typedef struct | |
320 { | |
321 long flags; | |
322 long functions; | |
323 long decorations; | |
324 long input_mode; | |
1236 | 325 long state; |
32 | 326 } MotifWmHints; |
327 | |
328 extern MotifWmHints vo_MotifWmHints; | |
329 extern Atom vo_MotifHints; | |
330 extern int vo_depthonscreen; | |
331 extern int vo_screenwidth; | |
332 extern int vo_screenheight; | |
333 | |
334 static MotifWmHints vo_MotifWmHints; | |
335 static Atom vo_MotifHints = None; | |
336 | |
1266 | 337 // Note: always d==0 ! |
32 | 338 void vo_x11_decoration( Display * vo_Display,Window w,int d ) |
339 { | |
1266 | 340 |
341 if(vo_fsmode&1){ | |
342 XSetWindowAttributes attr; | |
343 attr.override_redirect = True; | |
344 XChangeWindowAttributes(vo_Display, w, CWOverrideRedirect, &attr); | |
4437 | 345 // XMapWindow(vo_Display, w); |
1266 | 346 } |
347 | |
1415 | 348 if(vo_fsmode&8){ |
349 XSetTransientForHint (vo_Display, w, RootWindow(vo_Display,mScreen)); | |
350 } | |
351 | |
32 | 352 vo_MotifHints=XInternAtom( vo_Display,"_MOTIF_WM_HINTS",0 ); |
353 if ( vo_MotifHints != None ) | |
354 { | |
1236 | 355 memset( &vo_MotifWmHints,0,sizeof( MotifWmHints ) ); |
356 vo_MotifWmHints.flags=MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; | |
357 vo_MotifWmHints.functions=MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE; | |
358 if ( d ) d=MWM_DECOR_ALL; | |
1266 | 359 vo_MotifWmHints.decorations=d|((vo_fsmode&2)?0:MWM_DECOR_MENU); |
32 | 360 XChangeProperty( vo_Display,w,vo_MotifHints,vo_MotifHints,32, |
1266 | 361 PropModeReplace,(unsigned char *)&vo_MotifWmHints,(vo_fsmode&4)?4:5 ); |
32 | 362 } |
363 } | |
364 | |
1137
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
365 void vo_x11_classhint( Display * display,Window window,char *name ){ |
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
366 XClassHint wmClass; |
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
367 wmClass.res_name = name; |
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
368 wmClass.res_class = "MPlayer"; |
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
369 XSetClassHint(display,window,&wmClass); |
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
370 } |
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
371 |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1501
diff
changeset
|
372 #ifdef HAVE_NEW_GUI |
723 | 373 Window vo_window = None; |
374 GC vo_gc; | |
375 int vo_xeventhandling = 1; | |
376 int vo_resize = 0; | |
377 int vo_expose = 0; | |
378 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1501
diff
changeset
|
379 void vo_setwindow( Window w,GC g ) { |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1501
diff
changeset
|
380 vo_window=w; vo_gc=g; |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1501
diff
changeset
|
381 vo_xeventhandling=0; |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1501
diff
changeset
|
382 } |
1746 | 383 void vo_setwindowsize( int w,int h ) { |
384 vo_dwidth=w; vo_dheight=h; | |
385 } | |
723 | 386 #endif |
387 | |
4437 | 388 int vo_x11_uninit(Display *display, Window window) |
389 { | |
390 #ifdef HAVE_NEW_GUI | |
391 /* destroy window only if it's not controlled by GUI */ | |
392 if (vo_window == None) | |
393 #endif | |
394 { | |
395 /* and -wid is set */ | |
396 if (!(WinID > 0)) | |
397 XDestroyWindow(display, window); | |
4438
e01ee848935f
grr, 10l. vo_x11_uninit: close display only if window not created by GUI
alex
parents:
4437
diff
changeset
|
398 XCloseDisplay(display); |
4437 | 399 } |
400 return(1); | |
401 } | |
402 | |
32 | 403 int vo_x11_check_events(Display *mydisplay){ |
404 int ret=0; | |
405 XEvent Event; | |
406 char buf[100]; | |
407 KeySym keySym; | |
1038
b36fb1ae4b53
applied solaris8/netbsd/other fixes patch by Jrgen Keil <jk@tools.de>
arpi_esp
parents:
922
diff
changeset
|
408 static XComposeStatus stat; |
32 | 409 // unsigned long vo_KeyTable[512]; |
410 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1501
diff
changeset
|
411 #ifdef HAVE_NEW_GUI |
723 | 412 if ( vo_xeventhandling ) |
413 { | |
414 #endif | |
415 while ( XPending( mydisplay ) ) | |
416 { | |
417 XNextEvent( mydisplay,&Event ); | |
418 switch( Event.type ) | |
419 { | |
420 case Expose: | |
421 ret|=VO_EVENT_EXPOSE; | |
422 break; | |
423 case ConfigureNotify: | |
424 vo_dwidth=Event.xconfigure.width; | |
425 vo_dheight=Event.xconfigure.height; | |
426 ret|=VO_EVENT_RESIZE; | |
427 break; | |
428 case KeyPress: | |
429 XLookupString( &Event.xkey,buf,sizeof(buf),&keySym,&stat ); | |
430 vo_x11_putkey( ( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) ) ); | |
431 ret|=VO_EVENT_KEYPRESS; | |
432 break; | |
4658 | 433 #ifdef HAVE_NEW_INPUT |
434 case ButtonPress: | |
435 // Ignore mouse whell press event | |
436 if(Event.xbutton.button == 4 || Event.xbutton.button == 5) | |
437 break; | |
438 mplayer_put_key((MOUSE_BTN0+Event.xbutton.button-1)|MP_KEY_DOWN); | |
439 break; | |
440 case ButtonRelease: | |
441 mplayer_put_key(MOUSE_BTN0+Event.xbutton.button-1); | |
442 break; | |
443 #endif | |
723 | 444 } |
445 } | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1501
diff
changeset
|
446 #ifdef HAVE_NEW_GUI |
32 | 447 } |
723 | 448 else |
449 { | |
450 if ( vo_resize ) | |
451 { | |
452 vo_resize=0; | |
453 ret|=VO_EVENT_RESIZE; | |
454 } | |
455 if ( vo_expose ) | |
456 { | |
457 vo_expose=0; | |
458 ret|=VO_EVENT_EXPOSE; | |
459 } | |
460 } | |
461 #endif | |
32 | 462 |
463 return ret; | |
464 } | |
465 | |
324 | 466 void saver_on(Display *mDisplay) { |
467 | |
1345
be674b95b485
x11_common does not compile, when the XDPMS extension is not available on the
jkeil
parents:
1266
diff
changeset
|
468 #ifdef HAVE_XDPMS |
324 | 469 int nothing; |
470 if (dpms_disabled) | |
471 { | |
458
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
472 if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
473 { |
741 | 474 if (!DPMSEnable(mDisplay)) { // restoring power saving settings |
475 printf("DPMS not available?\n"); | |
476 } else { | |
477 // DPMS does not seem to be enabled unless we call DPMSInfo | |
478 BOOL onoff; | |
479 CARD16 state; | |
480 DPMSInfo(mDisplay, &state, &onoff); | |
481 if (onoff) { | |
482 printf ("Successfully enabled DPMS\n"); | |
483 } else { | |
484 printf ("Could not enable DPMS\n"); | |
485 } | |
486 } | |
458
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
487 } |
324 | 488 } |
1345
be674b95b485
x11_common does not compile, when the XDPMS extension is not available on the
jkeil
parents:
1266
diff
changeset
|
489 #endif |
be674b95b485
x11_common does not compile, when the XDPMS extension is not available on the
jkeil
parents:
1266
diff
changeset
|
490 |
324 | 491 if (timeout_save) |
492 { | |
458
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
493 int dummy, interval, prefer_blank, allow_exp; |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
494 XGetScreenSaver(mDisplay, &dummy, &interval, &prefer_blank, &allow_exp); |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
495 XSetScreenSaver(mDisplay, timeout_save, interval, prefer_blank, allow_exp); |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
496 XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp); |
324 | 497 } |
498 | |
499 } | |
500 | |
501 void saver_off(Display *mDisplay) { | |
502 | |
1345
be674b95b485
x11_common does not compile, when the XDPMS extension is not available on the
jkeil
parents:
1266
diff
changeset
|
503 int interval, prefer_blank, allow_exp; |
be674b95b485
x11_common does not compile, when the XDPMS extension is not available on the
jkeil
parents:
1266
diff
changeset
|
504 #ifdef HAVE_XDPMS |
be674b95b485
x11_common does not compile, when the XDPMS extension is not available on the
jkeil
parents:
1266
diff
changeset
|
505 int nothing; |
324 | 506 |
507 if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) | |
508 { | |
458
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
509 BOOL onoff; |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
510 CARD16 state; |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
511 DPMSInfo(mDisplay, &state, &onoff); |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
512 if (onoff) |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
513 { |
741 | 514 Status stat; |
458
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
515 printf ("Disabling DPMS\n"); |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
516 dpms_disabled=1; |
741 | 517 stat = DPMSDisable(mDisplay); // monitor powersave off |
518 printf ("stat: %d\n", stat); | |
458
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
519 } |
324 | 520 } |
1345
be674b95b485
x11_common does not compile, when the XDPMS extension is not available on the
jkeil
parents:
1266
diff
changeset
|
521 #endif |
324 | 522 XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp); |
523 if (timeout_save) | |
458
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
524 XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp); |
49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
arpi_esp
parents:
456
diff
changeset
|
525 // turning off screensaver |
326 | 526 } |
448
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
440
diff
changeset
|
527 |
3990 | 528 |
529 | |
530 #ifdef HAVE_XINERAMA | |
531 void vo_x11_xinerama_move(Display *dsp, Window w) | |
532 { | |
533 if(XineramaIsActive(dsp)) | |
534 { | |
4017 | 535 /* printf("XXXX Xinerama screen: x: %hd y: %hd\n",xinerama_x,xinerama_y); */ |
536 XMoveWindow(dsp,w,xinerama_x,xinerama_y); | |
3990 | 537 } |
538 } | |
448
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
440
diff
changeset
|
539 #endif |
3990 | 540 |
4425
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
541 #ifdef HAVE_XF86VM |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
542 void vo_vm_switch(uint32_t X, uint32_t Y, int* modeline_width, int* modeline_height) |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
543 { |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
544 unsigned int vm_event, vm_error; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
545 unsigned int vm_ver, vm_rev; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
546 int i,j,have_vm=0; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
547 |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
548 int modecount; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
549 |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
550 if (XF86VidModeQueryExtension(mDisplay, &vm_event, &vm_error)) { |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
551 XF86VidModeQueryVersion(mDisplay, &vm_ver, &vm_rev); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
552 printf("XF86VidMode Extension v%i.%i\n", vm_ver, vm_rev); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
553 have_vm=1; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
554 } else |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
555 printf("XF86VidMode Extenstion not available.\n"); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
556 |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
557 if (have_vm) { |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
558 if (vidmodes==NULL) |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
559 XF86VidModeGetAllModeLines(mDisplay,mScreen,&modecount,&vidmodes); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
560 j=0; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
561 *modeline_width=vidmodes[0]->hdisplay; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
562 *modeline_height=vidmodes[0]->vdisplay; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
563 |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
564 for (i=1; i<modecount; i++) |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
565 if ((vidmodes[i]->hdisplay >= X) && (vidmodes[i]->vdisplay >= Y)) |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
566 if ( (vidmodes[i]->hdisplay < *modeline_width ) && (vidmodes[i]->vdisplay < *modeline_height) ) |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
567 { |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
568 *modeline_width=vidmodes[i]->hdisplay; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
569 *modeline_height=vidmodes[i]->vdisplay; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
570 j=i; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
571 } |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
572 |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
573 printf("XF86VM: Selected video mode %dx%d for image size %dx%d.\n",*modeline_width, *modeline_height, X, Y); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
574 XF86VidModeLockModeSwitch(mDisplay,mScreen,0); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
575 XF86VidModeSwitchToMode(mDisplay,mScreen,vidmodes[j]); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
576 XF86VidModeSwitchToMode(mDisplay,mScreen,vidmodes[j]); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
577 X=(vo_screenwidth-*modeline_width)/2; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
578 Y=(vo_screenheight-*modeline_height)/2; |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
579 XF86VidModeSetViewPort(mDisplay,mScreen,X,Y); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
580 } |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
581 } |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
582 |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
583 void vo_vm_close(Display *dpy) |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
584 { |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
585 #ifdef HAVE_NEW_GUI |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
586 if ((vidmodes!=NULL)&&( vo_window == None ) ) |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
587 #else |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
588 if (vidmodes!=NULL) |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
589 #endif |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
590 { |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
591 int screen; screen=DefaultScreen( dpy ); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
592 XF86VidModeSwitchToMode(dpy,screen,vidmodes[0]); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
593 XF86VidModeSwitchToMode(dpy,screen,vidmodes[0]); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
594 free(vidmodes); |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
595 } |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
596 } |
3990 | 597 #endif |
4425
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
598 |
6144f63cbaa1
common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
arpi
parents:
4181
diff
changeset
|
599 #endif |