summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid King <amigadave@amigadave.com>2014-03-31 18:54:40 +0100
committerDavid King <amigadave@amigadave.com>2014-03-31 18:54:40 +0100
commite799707762b7e338f1e0c48a6099ad9e5a48c2ba (patch)
tree00afea183d560a239600b505eb4d4d94a66b43e3 /src
parent7918045028a4d09407926bfab0ab4e3f2f0e6fb8 (diff)
downloadcheese-e799707762b7e338f1e0c48a6099ad9e5a48c2ba.tar.gz
Inhibit user switching and session idle
As recording video from a webcam is undesirable when combined with switching users, inhibit switching and session idling. https://bugzilla.gnome.org/show_bug.cgi?id=694214
Diffstat (limited to 'src')
-rw-r--r--src/cheese-application.vala11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cheese-application.vala b/src/cheese-application.vala
index 7c208210..7361c0d8 100644
--- a/src/cheese-application.vala
+++ b/src/cheese-application.vala
@@ -27,6 +27,7 @@ using Gst;
public class Cheese.Application : Gtk.Application
{
private GLib.Settings settings;
+ private uint inhibited = 0;
static string device;
@@ -307,6 +308,11 @@ public class Cheese.Application : Gtk.Application
effects.set_enabled (true);
main_window.camera_state_change_playing ();
+
+ inhibited = this.inhibit (main_window,
+ Gtk.ApplicationInhibitFlags.SWITCH
+ | Gtk.ApplicationInhibitFlags.IDLE,
+ _("Webcam in use"));
break;
case Gst.State.NULL:
effects.set_enabled (false);
@@ -314,6 +320,11 @@ public class Cheese.Application : Gtk.Application
shoot.set_enabled (false);
main_window.camera_state_change_null ();
+
+ if (inhibited != 0)
+ {
+ this.uninhibit (inhibited);
+ }
break;
default:
break;