Example #1
0
        public static void Inhibit()
        {
            try {
                IScreenSaver ss = Bus.Session.GetObject <IScreenSaver>("org.gnome.ScreenSaver", new ObjectPath("/org/gnome/ScreenSaver"));

                if (ss != null)
                {
                    ss.Inhibit("test-runner", "Running the Moonlight tests");
                }
            } catch {
            }
        }
Example #2
0
 /// <summary>
 /// Request that saving the screen due to system idleness be blocked
 /// until UnInhibit is called or the calling process exits.
 /// </summary>
 /// <param name="appname">
 /// A <see cref="System.String"/> containing the application name.
 /// </param>
 /// <param name="reason">
 /// A <see cref="System.String"/> containing the reason for inhibit.
 /// </param>
 /// <returns>
 /// A <see cref="System.UInt32"/> containing a randomly generated
 /// cookie identifying the inhibit request. Use this to uninhibit.
 /// </returns>
 public uint Inhibit(string appname, string reason)
 {
     return(m_screenSaver.Inhibit(appname, reason));
 }