From e799707762b7e338f1e0c48a6099ad9e5a48c2ba Mon Sep 17 00:00:00 2001 From: David King Date: Mon, 31 Mar 2014 18:54:40 +0100 Subject: 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 --- src/cheese-application.vala | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') 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; -- cgit v1.2.1