diff options
author | Ted Gould <ted@gould.cx> | 2014-02-28 16:25:09 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-02-28 16:25:09 -0600 |
commit | dd42fb51e44d1a1233e6a803a997af7c20b8dc56 (patch) | |
tree | 4a6746c989e5677af1ba29f7bfaaeb41fa26dd45 /src | |
parent | 3847d2c622e3cd838bd485403c1c4378aa57a637 (diff) | |
download | ayatana-indicator-sound-dd42fb51e44d1a1233e6a803a997af7c20b8dc56.tar.gz ayatana-indicator-sound-dd42fb51e44d1a1233e6a803a997af7c20b8dc56.tar.bz2 ayatana-indicator-sound-dd42fb51e44d1a1233e6a803a997af7c20b8dc56.zip |
Wait until we have data before saying that we can add the player
Diffstat (limited to 'src')
-rw-r--r-- | src/media-player-list-greeter.vala | 14 | ||||
-rw-r--r-- | src/media-player-user.vala | 4 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/media-player-list-greeter.vala b/src/media-player-list-greeter.vala index 2f1962e..101211d 100644 --- a/src/media-player-list-greeter.vala +++ b/src/media-player-list-greeter.vala @@ -73,7 +73,15 @@ public class MediaPlayerListGreeter : MediaPlayerList { } if (selected_user != null && !players.contains(selected_user)) { - players.insert(selected_user, new MediaPlayerUser(selected_user)); + var newplayer = new MediaPlayerUser(selected_user); + newplayer.notify["is-running"].connect((obj, prop) => { + MediaPlayerUser? player = obj as MediaPlayerUser; + if (player == null) return; + if (player.is_running && player.id == this.selected_user) + this.player_added(player); + }); + + players.insert(selected_user, newplayer); } if (old_user != null) { @@ -83,7 +91,9 @@ public class MediaPlayerListGreeter : MediaPlayerList { if (selected_user != null) { var new_player = players.lookup(selected_user); - player_added(new_player); + + if (new_player.is_running) + player_added(new_player); } } diff --git a/src/media-player-user.vala b/src/media-player-user.vala index 28ec5ae..a4b75c3 100644 --- a/src/media-player-user.vala +++ b/src/media-player-user.vala @@ -120,8 +120,8 @@ public class MediaPlayerUser : MediaPlayer { } }); - /* Update all of them -- we've got a proxy! */ - queue_property_notification("Timestamp"); + debug("Notifying player is ready for user: %s", this.username); + this.notify_property("is-running"); } catch (Error e) { this.proxy = null; warning("Unable to get proxy to user '%s' sound settings: %s", username, e.message); |