Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/Widgets/PlayerRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public class Sound.Widgets.PlayerRow : Gtk.Box {
private string app_name = _("Music player");
private string last_art_url;

private Gtk.GestureMultiPress gesture_click;

public string mpris_name = "";

private AppInfo? ainfo;
Expand Down Expand Up @@ -249,7 +251,10 @@ public class Sound.Widgets.PlayerRow : Gtk.Box {
update_controls ();
}

titles_events.button_press_event.connect (raise_player);
gesture_click = new Gtk.GestureMultiPress (titles_events) {
button = Gdk.BUTTON_PRIMARY
};
gesture_click.released.connect (raise_player);

prev_btn.clicked.connect (() => {
Idle.add (() => {
Expand Down Expand Up @@ -387,7 +392,7 @@ public class Sound.Widgets.PlayerRow : Gtk.Box {
});
}

private bool raise_player () {
private void raise_player (Gtk.GestureMultiPress gesture, int n_press, double x, double y) {
try {
close ();
if (client != null && client.player.can_raise) {
Expand Down Expand Up @@ -415,7 +420,8 @@ public class Sound.Widgets.PlayerRow : Gtk.Box {
warning ("Could not launch player");
}

return Gdk.EVENT_STOP;
gesture.set_state (CLAIMED);
gesture.reset ();
}

/**
Expand Down