[totem] browser-plugin: Fix warning inhibiting idle for hidden plugin



commit 2cb45dcc295b892be7b9424d61d004ed0645746a
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Apr 11 10:42:02 2014 +0200

    browser-plugin: Fix warning inhibiting idle for hidden plugin
    
    When the plugin is hidden, we shouldn't be inhibiting idle to
    prevent the screensaver coming on. It also fixes warnings
    at run-time as gtk_application_inhibit() expects a real window,
    not NULL.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693092

 browser-plugin/totem-plugin-viewer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/browser-plugin/totem-plugin-viewer.c b/browser-plugin/totem-plugin-viewer.c
index 4598faa..38bd638 100644
--- a/browser-plugin/totem-plugin-viewer.c
+++ b/browser-plugin/totem-plugin-viewer.c
@@ -323,7 +323,7 @@ totem_embedded_set_state (TotemEmbedded *emb, TotemStates state)
        }
 
        if (state == TOTEM_STATE_PLAYING) {
-               if (emb->inhibit_id == 0) {
+               if (emb->inhibit_id == 0 && GTK_IS_PLUG (emb->window)) {
                        emb->inhibit_id = gtk_application_inhibit (GTK_APPLICATION (emb),
                                                                   NULL,
                                                                   GTK_APPLICATION_INHIBIT_IDLE,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]