[gnome-music/gbsneto/untangle-player-window-mpris: 5/10] inhibitsuspend: Receive a GtkApplication



commit f25d9d1ff7d538d94f2d79d751f0a7dfc4982b41
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Apr 10 11:45:13 2019 -0300

    inhibitsuspend: Receive a GtkApplication
    
    Instead of receiving the toplevel directly, receive
    the application.

 gnomemusic/inhibitsuspend.py | 4 ++--
 gnomemusic/player.py         | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/inhibitsuspend.py b/gnomemusic/inhibitsuspend.py
index a35b44f9..b56a088a 100644
--- a/gnomemusic/inhibitsuspend.py
+++ b/gnomemusic/inhibitsuspend.py
@@ -43,10 +43,10 @@ class InhibitSuspend(GObject.GObject):
         return '<InhibitSuspend>'
 
     @log
-    def __init__(self, root_window, player):
+    def __init__(self, application, player):
         super().__init__()
 
-        self._application = root_window.get_application()
+        self._application = application
         self._player = player
         self._inhibit_cookie = 0
 
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index a2e7c89c..46201918 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -593,7 +593,8 @@ class Player(GObject.GObject):
             'state', self, 'state', GObject.BindingFlags.SYNC_CREATE)
 
         root_window = parent_window.get_toplevel()
-        self._inhibit_suspend = InhibitSuspend(root_window, self)
+        self._inhibit_suspend = InhibitSuspend(
+            root_window.props.application, self)
         self._pause_on_suspend = PauseOnSuspend(self)
 
         self._lastfm = LastFmScrobbler()


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