daemon: double check that the display is locked before speaking
authorAlex Badea <vamposdecampos@gmail.com>
Tue, 14 Sep 2010 20:32:36 +0000 (23:32 +0300)
committerAlex Badea <vamposdecampos@gmail.com>
Tue, 14 Sep 2010 20:32:36 +0000 (23:32 +0300)
Closes: #6005

src/daemon.c

index a645b35..3c6da74 100644 (file)
@@ -1,5 +1,6 @@
 #include <string.h>
 #include <stdlib.h>
+#include <signal.h>
 #include <time.h>
 #include <glib.h>
 #include <dbus/dbus-glib.h>
@@ -50,7 +51,8 @@ static void sig_display_status(DBusGProxy *proxy, const char *status, gpointer u
         * in the two ButtonPress events being received before the display_status==on
         * event.  Check here if that's the case.
         */
-       if (app->display_on && app->press_count > 1 && time(NULL) - app->last_press <= 1)
+       if (app->mode_locked && app->display_on && app->press_count > 1 &&
+                       time(NULL) - app->last_press <= 1)
                speak_time(app);
 }