diff options
author | David King <amigadave@amigadave.com> | 2014-03-31 18:54:40 +0100 |
---|---|---|
committer | David King <amigadave@amigadave.com> | 2014-03-31 18:54:40 +0100 |
commit | e799707762b7e338f1e0c48a6099ad9e5a48c2ba (patch) | |
tree | 00afea183d560a239600b505eb4d4d94a66b43e3 /src | |
parent | 7918045028a4d09407926bfab0ab4e3f2f0e6fb8 (diff) | |
download | cheese-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.vala | 11 |
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; |