[totem] screensaver: Wait 5 seconds before uninhibiting screensaver
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] screensaver: Wait 5 seconds before uninhibiting screensaver
- Date: Sun, 26 Jan 2014 13:56:34 +0000 (UTC)
commit 6accfa4fd0167f946faa7e9565f2401c4616b507
Author: Bastien Nocera <hadess hadess net>
Date: Sun Jan 26 14:46:08 2014 +0100
screensaver: Wait 5 seconds before uninhibiting screensaver
Otherwise the screensaver might come on in between 2 movies.
See https://bugzilla.gnome.org/show_bug.cgi?id=705942#c7
src/plugins/screensaver/totem-screensaver.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/screensaver/totem-screensaver.c b/src/plugins/screensaver/totem-screensaver.c
index c979b0c..36d7929 100644
--- a/src/plugins/screensaver/totem-screensaver.c
+++ b/src/plugins/screensaver/totem-screensaver.c
@@ -53,6 +53,7 @@ typedef struct {
gboolean inhibit_available;
guint handler_id_playing;
guint inhibit_cookie;
+ guint uninhibit_timeout;
} TotemScreensaverPluginPrivate;
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_SCREENSAVER_PLUGIN,
@@ -85,11 +86,29 @@ totem_screensaver_update_from_state (TotemObject *totem,
}
}
+static gboolean
+uninhibit_timeout_cb (TotemScreensaverPlugin *pi)
+{
+ totem_screensaver_update_from_state (pi->priv->totem, pi);
+ pi->priv->uninhibit_timeout = 0;
+ return G_SOURCE_REMOVE;
+}
+
static void
property_notify_cb (TotemObject *totem,
GParamSpec *spec,
TotemScreensaverPlugin *pi)
{
+ if (pi->priv->uninhibit_timeout != 0) {
+ g_source_remove (pi->priv->uninhibit_timeout);
+ pi->priv->uninhibit_timeout = 0;
+ }
+
+ if (totem_object_is_playing (totem) == FALSE) {
+ pi->priv->uninhibit_timeout = g_timeout_add_seconds (5, (GSourceFunc) uninhibit_timeout_cb,
pi);
+ return;
+ }
+
totem_screensaver_update_from_state (totem, pi);
}
@@ -127,6 +146,11 @@ impl_deactivate (PeasActivatable *plugin)
pi->priv->handler_id_playing = 0;
}
+ if (pi->priv->uninhibit_timeout != 0) {
+ g_source_remove (pi->priv->uninhibit_timeout);
+ pi->priv->uninhibit_timeout = 0;
+ }
+
if (pi->priv->inhibit_cookie != 0) {
gtk_application_uninhibit (GTK_APPLICATION (pi->priv->totem), pi->priv->inhibit_cookie);
pi->priv->inhibit_cookie = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]