Merge lp:~elementary-dev-community/audience/prevent-screen-timeout into lp:~audience-members/audience/trunk

Proposed by Cameron Norman on 2015-06-25
Status: Rejected
Rejected by: Cody Garver on 2016-05-02
Proposed branch: lp:~elementary-dev-community/audience/prevent-screen-timeout
Merge into: lp:~audience-members/audience/trunk
Diff against target: 64 lines (+22/-1)
3 files modified
src/CMakeLists.txt (+3/-1)
src/Widgets/VideoPlayer.vala (+12/-0)
vapi/DPMS.vapi (+7/-0)
To merge this branch: bzr merge lp:~elementary-dev-community/audience/prevent-screen-timeout
Reviewer Review Type Date Requested Status
Viko Adi Rahmawan Disapprove on 2015-09-13
xapantu (community) 2015-06-25 Needs Fixing on 2015-08-20
Review via email: mp+262939@code.launchpad.net

Commit message

Disable DPMS to prevent screensaver and locking

Description of the change

Disable DPMS to prevent screensaver and locking

To post a comment you must log in.
Cody Garver (codygarver) wrote :

I would prefer if this was a build flag instead so this x dependency becomes optional

xapantu (xapantu) wrote :

Yes, we want to avoid hard-dependency on X as we are slowly switching to wayland in the years to come.

On top of that, maybe that could be done at a gala level, I think we should disallow screen-timeout when a video player is launched/playing (but we can add this to audience for now).

review: Needs Fixing
Viko Adi Rahmawan (vikoadi) wrote :

this is definitely not the way to go,
the problem is in os level and should be fixed there
audience have done enough to signal inhibit to sessionmanager

maybe we should have a daemon equal to gnomepower or fix gnome power management to inhibit our lockscreen

review: Disapprove

Unmerged revisions

530. By Cameron Norman on 2015-06-25

Disable DPMS to prevent screensaver and locking

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/CMakeLists.txt'
2--- src/CMakeLists.txt 2015-03-28 15:27:19 +0000
3+++ src/CMakeLists.txt 2015-06-25 07:23:23 +0000
4@@ -11,7 +11,7 @@
5 # pkgconfig, real C code
6 find_package (PkgConfig)
7
8-set (PKG_DEPS granite>=0.3.0 clutter-gtk-1.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-tag-1.0)
9+set (PKG_DEPS granite>=0.3.0 clutter-gtk-1.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-tag-1.0 xext)
10 set (VALA_DEPS
11 granite>=0.3.0
12 clutter-gtk-1.0
13@@ -64,6 +64,8 @@
14 Widgets/VideoPlayer.vala
15 PACKAGES
16 ${VALA_DEPS}
17+ CUSTOM_VAPIS
18+ ../vapi/DPMS.vapi
19 OPTIONS
20 ${GLOBAL_VALAC_OPTIONS}
21 --enable-experimental
22
23=== modified file 'src/Widgets/VideoPlayer.vala'
24--- src/Widgets/VideoPlayer.vala 2015-05-16 10:13:38 +0000
25+++ src/Widgets/VideoPlayer.vala 2015-06-25 07:23:23 +0000
26@@ -56,6 +56,7 @@
27 return;
28
29 set_screensaver (!value);
30+ set_dpms (!value);
31 set_screenlock (!value);
32 playbin.set_state (value ? Gst.State.PLAYING : Gst.State.PAUSED);
33 _playing = value;
34@@ -445,6 +446,17 @@
35 dpy.set_screensaver (enable ? timeout : 0, interval, prefer_blanking, allow_exposures);
36 }
37
38+ void set_dpms (bool enable) {
39+ if (dpy == null)
40+ dpy = new X.Display ();
41+
42+ if (enable) {
43+ DPMS.enable (dpy);
44+ } else {
45+ DPMS.disable (dpy);
46+ }
47+ }
48+
49 //prevent screenlocking in Gnome 3 using org.gnome.SessionManager
50 void set_screenlock (bool enable) {
51 try {
52
53=== added directory 'vapi'
54=== added file 'vapi/DPMS.vapi'
55--- vapi/DPMS.vapi 1970-01-01 00:00:00 +0000
56+++ vapi/DPMS.vapi 2015-06-25 07:23:23 +0000
57@@ -0,0 +1,7 @@
58+[CCode (cheader_filename = "X11/extensions/dpms.h")]
59+namespace DPMS {
60+ [CCode (cname = "DPMSEnable")]
61+ X.Status enable (X.Display x);
62+ [CCode (cname = "DPMSDisable")]
63+ X.Status disable (X.Display x);
64+}

Subscribers

People subscribed via source and target branches