mirror of
https://github.com/mpv-player/mpv
synced 2025-01-11 09:29:29 +00:00
Activating/Deactivating of XScreenSaver
patch by Joachim Breitner <mail@joachim-breitner.de> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6304 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
5a1dc02ec1
commit
d20d9e132a
@ -69,6 +69,7 @@ extern int ao_pcm_waveheader;
|
||||
extern char *mDisplayName;
|
||||
extern int WinID;
|
||||
extern int ice_layer;
|
||||
extern int stop_xscreensaver;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AA
|
||||
@ -243,6 +244,8 @@ static config_t mplayer_opts[]={
|
||||
{"wid", &WinID, CONF_TYPE_INT, 0, 0, 0, NULL},
|
||||
{"rootwin", &WinID, CONF_TYPE_FLAG, 0, -1, 0, NULL},
|
||||
{"icelayer", &ice_layer, CONF_TYPE_INT, CONF_RANGE, 0, 15, NULL},
|
||||
{"stop_xscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
||||
{"nostop_xscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 1, 0, NULL},
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XINERAMA
|
||||
|
@ -55,11 +55,13 @@
|
||||
#define vo_wm_WMakerStyle 4
|
||||
|
||||
int ice_layer=12;
|
||||
int stop_xscreensaver=0;
|
||||
|
||||
extern int verbose;
|
||||
|
||||
static int dpms_disabled=0;
|
||||
static int timeout_save=0;
|
||||
static int xscreensaver_was_running=0;
|
||||
|
||||
char* mDisplayName=NULL;
|
||||
Display* mDisplay=NULL;
|
||||
@ -798,6 +800,9 @@ void saver_on(Display *mDisplay) {
|
||||
XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
|
||||
}
|
||||
|
||||
if (xscreensaver_was_running && stop_xscreensaver)
|
||||
system("xscreensaver -no-splash &");
|
||||
|
||||
}
|
||||
|
||||
void saver_off(Display *mDisplay) {
|
||||
@ -824,6 +829,7 @@ void saver_off(Display *mDisplay) {
|
||||
XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
|
||||
if (timeout_save)
|
||||
XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp);
|
||||
xscreensaver_was_running = stop_xscreensaver && ! system("xscreensaver-command -exit");
|
||||
// turning off screensaver
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user