[gnome-music/wip/mschraal/window-disallow-type-search-on-startup: 4/4] window: Typeahead search only when views are loaded




commit 36041f9f65cfdebc356a16c827cbf0472a8281ca
Author: Marinus Schraal <mschraal gnome org>
Date:   Tue Apr 5 11:14:31 2022 +0200

    window: Typeahead search only when views are loaded
    
    On startup when immediately typing on the keyboard, the views are not
    yet loaded and this resulted in an error for the typeahead search.
    
    Check that the views are loaded before allowing typeahead search.

 gnomemusic/window.py | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 0c6d00da2..93f1b27d6 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -374,6 +374,7 @@ class Window(Adw.ApplicationWindow):
                 and GLib.unichar_isprint(chr(key_unic))
                 and (modifiers == shift_mask
                      or modifiers == 0)
+                and self.views[View.PLAYLIST] is not None
                 and not self.views[View.PLAYLIST].rename_active
                 and not self.props.selection_mode
                 and self._headerbar.props.state != HeaderBar.State.SEARCH):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]