From da14ac2ef65359de5747eddd63c41cc7a512dc5b Mon Sep 17 00:00:00 2001 From: Martin Wagner Date: Wed, 23 Nov 2022 18:34:53 +0100 Subject: [PATCH] don't unset cursor in SelectionList When no cursor is set in SelectionList and the keyboard focus enters the widget a "item-reselected" is triggered. --- src/mpdevil.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mpdevil.py b/src/mpdevil.py index d7ae422..d072008 100755 --- a/src/mpdevil.py +++ b/src/mpdevil.py @@ -1667,7 +1667,7 @@ class SelectionList(TreeView): return len(self._store)-1 def select_path(self, path): - self._selection.select_path(path) + self.set_cursor(path) def select(self, item): row_num=len(self._store) @@ -1690,7 +1690,6 @@ class SelectionList(TreeView): return self.get_item_at_path(self.get_path_selected()) def scroll_to_selected(self): - self.set_cursor(Gtk.TreePath(len(self._store)), None, False) # unset cursor self.save_scroll_to_cell(self._selected_path, None, True, 0.25) def _on_selection_changed(self, *args):