annotate libvo/x11_common.c @ 456:884ea555b1a2

add mixer keys
author pontscho
date Sun, 15 Apr 2001 23:09:14 +0000
parents 198b46b739d8
children 49b0474b2e26
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
2 #include <stdio.h>
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
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
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
10 #include <unistd.h>
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
11 #include <sys/mman.h>
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
12
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
13 #include "video_out.h"
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
14
324
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
15 #include <X11/Xmd.h>
32
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
16 #include <X11/Xlib.h>
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
17 #include <X11/Xutil.h>
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
18 #include <X11/Xatom.h>
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
19
448
198b46b739d8 qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents: 440
diff changeset
20 #include <X11/extensions/dpms.h>
198b46b739d8 qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents: 440
diff changeset
21
324
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
22 static int dpms_disabled=0;
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
23 static int timeout_save=0;
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
24
384
b0e4e5744899 Autohide X11 cursor
lgb
parents: 369
diff changeset
25
b0e4e5744899 Autohide X11 cursor
lgb
parents: 369
diff changeset
26 void vo_hidecursor ( Display *disp , Window win )
b0e4e5744899 Autohide X11 cursor
lgb
parents: 369
diff changeset
27 {
456
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
28 Cursor no_ptr;
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
29 Pixmap bm_no;
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
30 XColor black,dummy;
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
31 Colormap colormap;
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
32 static unsigned char bm_no_data[] = { 0,0,0,0, 0,0,0,0 };
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
33
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
34 colormap = DefaultColormap(disp,DefaultScreen(disp));
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
35 XAllocNamedColor(disp,colormap,"black",&black,&dummy);
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
36 bm_no = XCreateBitmapFromData(disp, win, bm_no_data, 8,8);
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
37 no_ptr=XCreatePixmapCursor(disp, bm_no, bm_no,&black, &black,0, 0);
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
38 XDefineCursor(disp,win,no_ptr);
384
b0e4e5744899 Autohide X11 cursor
lgb
parents: 369
diff changeset
39 }
b0e4e5744899 Autohide X11 cursor
lgb
parents: 369
diff changeset
40
b0e4e5744899 Autohide X11 cursor
lgb
parents: 369
diff changeset
41
32
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
42 int vo_init( void )
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
43 {
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
44 int CompletionType = -1;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
45 int mScreen;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
46 int bpp;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
47 char * DisplayName = ":0.0";
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
48 Display * mDisplay;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
49 XImage * mXImage;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
50 Window mRootWin;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
51 static XWindowAttributes attribs;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
52
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
53 if(vo_depthonscreen) return 1; // already called
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
54
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
55 if ( getenv( "DISPLAY" ) ) DisplayName=getenv( "DISPLAY" );
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
56 mDisplay=XOpenDisplay( DisplayName );
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
57 if ( !mDisplay )
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
58 {
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
59 fprintf( stderr,"vo: couldn't open the X11 display!\n" );
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
60 return 0;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
61 }
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
62 mScreen=DefaultScreen( mDisplay ); // Screen ID.
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
63 mRootWin=RootWindow( mDisplay,mScreen );// Root window ID.
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
64 vo_screenwidth=DisplayWidth( mDisplay,mScreen );
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
65 vo_screenheight=DisplayHeight( mDisplay,mScreen );
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
66 // get color depth:
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
67 // XGetWindowAttributes(mydisplay, DefaultRootWindow(mDisplay), &attribs);
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
68 XGetWindowAttributes(mDisplay, mRootWin, &attribs);
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
69 vo_depthonscreen=attribs.depth;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
70 // get bits/pixel:
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
71 mXImage=XGetImage( mDisplay,mRootWin,0,0,1,1,AllPlanes,ZPixmap );
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
72 bpp=mXImage->bits_per_pixel;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
73 XDestroyImage( mXImage );
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
74 if((vo_depthonscreen+7)/8 != (bpp+7)/8) vo_depthonscreen=bpp; // by A'rpi
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
75 XCloseDisplay( mDisplay );
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
76 printf("X11 running at %dx%d depth: %d\n",vo_screenwidth,vo_screenheight,vo_depthonscreen);
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
77 return 1;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
78 }
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
79
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
80 #include "../linux/keycodes.h"
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
81 #include "wskeys.h"
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
82
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
83 extern void mplayer_put_key(int code);
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
84
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
85 void vo_x11_putkey(int key){
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
86 switch ( key )
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
87 {
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
88 case wsLeft: mplayer_put_key(KEY_LEFT); break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
89 case wsRight: mplayer_put_key(KEY_RIGHT); break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
90 case wsUp: mplayer_put_key(KEY_UP); break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
91 case wsDown: mplayer_put_key(KEY_DOWN); break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
92 case wsSpace: mplayer_put_key(' '); break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
93 case wsEscape: mplayer_put_key(KEY_ESC); break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
94 case wsEnter: mplayer_put_key(KEY_ENTER); break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
95 case wsq:
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
96 case wsQ: mplayer_put_key('q'); break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
97 case wsp:
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
98 case wsP: mplayer_put_key('p'); break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
99 case wsMinus:
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
100 case wsGrayMinus: mplayer_put_key('-'); break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
101 case wsPlus:
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
102 case wsGrayPlus: mplayer_put_key('+'); break;
456
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
103 case wsGrayMul:
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
104 case wsMul: mplayer_put_key('*'); break;
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
105 case wsGrayDiv:
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
106 case wsDiv: mplayer_put_key('/'); break;
369
b1a706452eeb pass keys a-z && A-Z
arpi_esp
parents: 326
diff changeset
107 default: if((key>='a' && key<='z')||(key>='A' && key<='Z')) mplayer_put_key(key);
32
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
108 }
369
b1a706452eeb pass keys a-z && A-Z
arpi_esp
parents: 326
diff changeset
109
32
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
110 }
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
111
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
112
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
113 // ----- Motif header: -------
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
114
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
115 #define MWM_HINTS_DECORATIONS 2
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
116
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
117 typedef struct
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
118 {
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
119 long flags;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
120 long functions;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
121 long decorations;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
122 long input_mode;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
123 } MotifWmHints;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
124
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
125 extern MotifWmHints vo_MotifWmHints;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
126 extern Atom vo_MotifHints;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
127 extern int vo_depthonscreen;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
128 extern int vo_screenwidth;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
129 extern int vo_screenheight;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
130
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
131 static MotifWmHints vo_MotifWmHints;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
132 static Atom vo_MotifHints = None;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
133
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
134 void vo_x11_decoration( Display * vo_Display,Window w,int d )
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
135 {
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
136 vo_MotifHints=XInternAtom( vo_Display,"_MOTIF_WM_HINTS",0 );
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
137 if ( vo_MotifHints != None )
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
138 {
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
139 vo_MotifWmHints.flags=2;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
140 vo_MotifWmHints.decorations=d;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
141 XChangeProperty( vo_Display,w,vo_MotifHints,vo_MotifHints,32,
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
142 PropModeReplace,(unsigned char *)&vo_MotifWmHints,4 );
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
143 }
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
144 }
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
145
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
146 int vo_x11_check_events(Display *mydisplay){
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
147 int ret=0;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
148 XEvent Event;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
149 char buf[100];
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
150 KeySym keySym;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
151 XComposeStatus stat;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
152 // unsigned long vo_KeyTable[512];
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
153
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
154 while ( XPending( mydisplay ) )
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
155 {
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
156 XNextEvent( mydisplay,&Event );
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
157 switch( Event.type )
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
158 {
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
159 case Expose:
456
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
160 ret|=VO_EVENT_EXPOSE;
32
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
161 break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
162 case ConfigureNotify:
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
163 vo_dwidth=Event.xconfigure.width;
456
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
164 vo_dheight=Event.xconfigure.height;
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
165 ret|=VO_EVENT_RESIZE;
32
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
166 break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
167 case KeyPress:
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
168 XLookupString( &Event.xkey,buf,sizeof(buf),&keySym,&stat );
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
169 vo_x11_putkey( ( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) ) );
456
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
170 ret|=VO_EVENT_KEYPRESS;
32
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
171 break;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
172 }
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
173 }
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
174
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
175 return ret;
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
176 }
9e66f722790e the common x11 stuff
arpi_esp
parents:
diff changeset
177
324
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
178 void saver_on(Display *mDisplay) {
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
179
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
180 int nothing;
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
181 if (dpms_disabled)
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
182 {
456
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
183 if (DPMSQueryExtension(mDisplay, &nothing, &nothing))
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
184 {
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
185 printf ("Enabling DPMS\n");
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
186 DPMSEnable(mDisplay); // restoring power saving settings
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
187 DPMSQueryExtension(mDisplay, &nothing, &nothing);
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
188 }
324
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
189 }
456
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
190
324
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
191 if (timeout_save)
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
192 {
456
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
193 int dummy, interval, prefer_blank, allow_exp;
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
194 XGetScreenSaver(mDisplay, &dummy, &interval, &prefer_blank, &allow_exp);
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
195 XSetScreenSaver(mDisplay, timeout_save, interval, prefer_blank, allow_exp);
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
196 XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
324
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
197 }
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
198
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
199 }
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
200
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
201 void saver_off(Display *mDisplay) {
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
202
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
203 int interval, prefer_blank, allow_exp, nothing;
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
204
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
205 if (DPMSQueryExtension(mDisplay, &nothing, &nothing))
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
206 {
456
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
207 BOOL onoff;
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
208 CARD16 state;
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
209 DPMSInfo(mDisplay, &state, &onoff);
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
210 if (onoff)
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
211 {
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
212 printf ("Disabling DPMS\n");
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
213 dpms_disabled=1;
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
214 DPMSDisable(mDisplay); // monitor powersave off
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
215 }
324
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
216 }
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
217 XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 32
diff changeset
218 if (timeout_save)
456
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
219 XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp);
884ea555b1a2 add mixer keys
pontscho
parents: 448
diff changeset
220 // turning off screensaver
326
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents: 324
diff changeset
221 }
448
198b46b739d8 qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents: 440
diff changeset
222
198b46b739d8 qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents: 440
diff changeset
223 #endif