elementary-dev-community team mailing list archive
-
elementary-dev-community team
-
Mailing list archive
-
Message #03298
[Merge] lp:~elementary-dev-community/audience/prevent-screen-timeout into lp:audience
Cameron Norman has proposed merging lp:~elementary-dev-community/audience/prevent-screen-timeout into lp:audience.
Commit message:
Disable DPMS to prevent screensaver and locking
Requested reviews:
Audience Members (audience-members)
Related bugs:
Bug #903849 in Audience: "monitor sleeps during playback"
https://bugs.launchpad.net/audience/+bug/903849
For more details, see:
https://code.launchpad.net/~elementary-dev-community/audience/prevent-screen-timeout/+merge/262939
Disable DPMS to prevent screensaver and locking
--
Your team elementary Developer Community is subscribed to branch lp:~elementary-dev-community/audience/prevent-screen-timeout.
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2015-03-28 15:27:19 +0000
+++ src/CMakeLists.txt 2015-06-25 07:23:23 +0000
@@ -11,7 +11,7 @@
# pkgconfig, real C code
find_package (PkgConfig)
-set (PKG_DEPS granite>=0.3.0 clutter-gtk-1.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-tag-1.0)
+set (PKG_DEPS granite>=0.3.0 clutter-gtk-1.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-tag-1.0 xext)
set (VALA_DEPS
granite>=0.3.0
clutter-gtk-1.0
@@ -64,6 +64,8 @@
Widgets/VideoPlayer.vala
PACKAGES
${VALA_DEPS}
+ CUSTOM_VAPIS
+ ../vapi/DPMS.vapi
OPTIONS
${GLOBAL_VALAC_OPTIONS}
--enable-experimental
=== modified file 'src/Widgets/VideoPlayer.vala'
--- src/Widgets/VideoPlayer.vala 2015-05-16 10:13:38 +0000
+++ src/Widgets/VideoPlayer.vala 2015-06-25 07:23:23 +0000
@@ -56,6 +56,7 @@
return;
set_screensaver (!value);
+ set_dpms (!value);
set_screenlock (!value);
playbin.set_state (value ? Gst.State.PLAYING : Gst.State.PAUSED);
_playing = value;
@@ -445,6 +446,17 @@
dpy.set_screensaver (enable ? timeout : 0, interval, prefer_blanking, allow_exposures);
}
+ void set_dpms (bool enable) {
+ if (dpy == null)
+ dpy = new X.Display ();
+
+ if (enable) {
+ DPMS.enable (dpy);
+ } else {
+ DPMS.disable (dpy);
+ }
+ }
+
//prevent screenlocking in Gnome 3 using org.gnome.SessionManager
void set_screenlock (bool enable) {
try {
=== added directory 'vapi'
=== added file 'vapi/DPMS.vapi'
--- vapi/DPMS.vapi 1970-01-01 00:00:00 +0000
+++ vapi/DPMS.vapi 2015-06-25 07:23:23 +0000
@@ -0,0 +1,7 @@
+[CCode (cheader_filename = "X11/extensions/dpms.h")]
+namespace DPMS {
+ [CCode (cname = "DPMSEnable")]
+ X.Status enable (X.Display x);
+ [CCode (cname = "DPMSDisable")]
+ X.Status disable (X.Display x);
+}
Follow ups