Alternate way to blank screen on lock
authorEnrico Zini <enrico@enricozini.org>
Sat, 22 Aug 2009 21:55:09 +0000 (22:55 +0100)
committerEnrico Zini <enrico@enricozini.org>
Sat, 22 Aug 2009 21:55:09 +0000 (22:55 +0100)
TODO
src/app_power.vala

diff --git a/TODO b/TODO
index f0e9fd2923e4a5e5fcd754a882710140fa746a27..ba51d0456b400c10e998753b4e3a9bcc54af59c4 100644 (file)
--- a/TODO
+++ b/TODO
@@ -42,6 +42,8 @@ Features to add:
  - Split polygen applet in a separate app, ran via a .desktop file
    (faster zavai startup time, can then integrate a browser in the polygen
     applet, makes more sense altogether)
+ - Is there a way to lock the screen completely turning off the touchscreen, so
+   that interrupts are not even generated?
 
 Not quite needed yet:
  - GPX log with more features (quality, course, speed, ...)
index 1f34c80fae7cf4d86dce62f6a51024fe1d7ac992..68dfc0f3b2c934f41c344cdc8c8931637b6ac9db 100644 (file)
@@ -114,6 +114,8 @@ public class Power : zavai.Resource, Object
                                return;
                        }
 
+                       // FIXME: X won't see events, but it's still generating interrupts,
+                       // isn't it?
                        int EVIOCGRAB = 0x40044590;
                        if (Posix.ioctl(screen_lock_fd, EVIOCGRAB, locked ? 1 : 0) != 0)
                        {
@@ -337,7 +339,7 @@ public class RebootButton : Gtk.Button
 public class Backlight: zavai.Service
 {
        public dynamic DBus.Object usage;
-       public dynamic DBus.Object display;
+       //public dynamic DBus.Object display;
 
        public Backlight()
        {
@@ -348,10 +350,12 @@ public class Backlight: zavai.Service
                        "/org/freesmartphone/Usage",
                        "org.freesmartphone.Usage");
 
+               /*
                display = zavai.registry.sbus.get_object(
                        "org.freesmartphone.odeviced",
                        "/org/freesmartphone/Device/Display/0",
                        "org.freesmartphone.Device.Display");
+               */
        }
 
        // Turn the backlight and then let it fade off
@@ -371,7 +375,13 @@ public class Backlight: zavai.Service
                if (!started)
                {
                        try {
-                               display.SetBacklightPower(false);
+                               //display.SetBacklightPower(false);
+                               string policy = usage.GetResourcePolicy("Display");
+                               if (policy == "auto")
+                               {
+                                       usage.SetResourcePolicy("Display", "disabled");
+                                       usage.SetResourcePolicy("Display", "auto");
+                               }
                        } catch (GLib.Error e) {
                                zavai.log.error(e.message);
                        }