[gnome-music/gbsneto/untangle-player-window-mpris: 4/10] inhibitsuspend: Use the application's active window
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/gbsneto/untangle-player-window-mpris: 4/10] inhibitsuspend: Use the application's active window
- Date: Fri, 12 Apr 2019 12:58:11 +0000 (UTC)
commit 1ae970c2a642ade5aec7aa0df1e3f2e1ffb8cdb5
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Apr 10 11:38:16 2019 -0300
inhibitsuspend: Use the application's active window
Instead of storing both the root window and the application,
simply use application.props.active_window and don't store
the root window.
This will help untangling Player from Window.
gnomemusic/inhibitsuspend.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/inhibitsuspend.py b/gnomemusic/inhibitsuspend.py
index e6ea5f6a..a35b44f9 100644
--- a/gnomemusic/inhibitsuspend.py
+++ b/gnomemusic/inhibitsuspend.py
@@ -46,7 +46,6 @@ class InhibitSuspend(GObject.GObject):
def __init__(self, root_window, player):
super().__init__()
- self._root_window = root_window
self._application = root_window.get_application()
self._player = player
self._inhibit_cookie = 0
@@ -62,8 +61,10 @@ class InhibitSuspend(GObject.GObject):
def _inhibit_suspend(self):
if (self._inhibit_cookie == 0
and self._should_inhibit):
+ active_window = self._application.props.active_window
+
self._inhibit_cookie = self._application.inhibit(
- self._root_window, Gtk.ApplicationInhibitFlags.SUSPEND,
+ active_window, Gtk.ApplicationInhibitFlags.SUSPEND,
_("Playing music"))
if self._inhibit_cookie == 0:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]