From 1fd5a75567ca49a55add6afc8f3d34fc76404924 Mon Sep 17 00:00:00 2001 From: Martin Wagner Date: Thu, 29 Dec 2022 18:43:57 +0100 Subject: [PATCH] avoid double seek --- src/mpdevil.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mpdevil.py b/src/mpdevil.py index 329821a..6e7a017 100755 --- a/src/mpdevil.py +++ b/src/mpdevil.py @@ -2788,11 +2788,13 @@ class SeekBar(Gtk.Box): self._scale.clear_marks() def _on_scale_button_press_event(self, widget, event): - self._update=False + if (event.button == 1 or event.button == 3) and event.type == Gdk.EventType.BUTTON_PRESS: + self._update=False def _on_scale_button_release_event(self, widget, event): - self._update=True - self._client.seekcur(self._scale.get_value()) + if event.button == 1 or event.button == 3: + self._update=True + self._client.seekcur(self._scale.get_value()) def _on_change_value(self, scale, scroll, value): if scroll in (Gtk.ScrollType.STEP_BACKWARD, Gtk.ScrollType.STEP_FORWARD , Gtk.ScrollType.PAGE_BACKWARD, Gtk.ScrollType.PAGE_FORWARD):