After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777238 - Behaviour of back ui button and short cut <ALT> + Left is not same.
Behaviour of back ui button and short cut <ALT> + Left is not same.
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
3.23.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-music-maint
gnome-music-maint
Depends on:
Blocks: 771934
 
 
Reported: 2017-01-13 22:12 UTC by Abhinav Singh
Modified: 2017-12-19 12:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Matched the behaviour of navigating back - ui/shortcut (1.74 KB, patch)
2017-01-13 22:23 UTC, Abhinav Singh
accepted-commit_now Details | Review

Description Abhinav Singh 2017-01-13 22:12:16 UTC
Observations:
Go to albums > click an album > search for tracks > [go back] > turn search off

[go back] by <Alt> + Left : stuck at single album with no way to go back to albums.

[go back] by UI button : present at albums view -- no problem.

Observations (if 777235 patched):
---
https://bugzilla.gnome.org/show_bug.cgi?id=777235
Hide the search view and search bar, and then go back.
---
Along with the observations from without 777235 patched, the behaviour difference also causes the search bar to not disappear.

Reasoning:
Shortut (window.py) has a different implementation of going back, while back button (toolbar.py) has a different implementation.
Comment 1 Abhinav Singh 2017-01-13 22:23:04 UTC
Created attachment 343458 [details] [review]
Matched the behaviour of navigating back - ui/shortcut

Shortcut navigation back behaviour was missing some conditions while ui behaviour was good.
Hence now calling the same function.
Comment 2 Abhinav Singh 2017-01-14 11:24:09 UTC
I just saw that baseview.py does not have an implementation of back_button_clicked.
Hence the above patch breaks the back navigation in artists/songs view.
------

When back navigation is done, there are these things that needs to be done,
1> Reset toolbar state
2> Set visible child view
3> If search is on, disable it
4> If selection is on, disable it (not sure)

Currently this happens,

back button ui :
reset toolbar (toolbar.py) > set visible child, reset header title (albumsview.py)

back button shortcut :
reset toolbar, set visible child (window.py)

Both currently are incomplete and have different implementation.

Solution:

On back shortcut(Alt+left) call the toolbar.py back_button_clicked.

In back_button_clicked:
> ask the toolbar to reset itself
> ask the current view to go back (ie baseview.py has implementation of back_clicked)
> ask the toolbar to disable search/selection

This is also solve another problem,
-----
[window.py, back shortcut]
if (self.toolbar._state != ToolbarState.MAIN):
    self.curr_view.set_visible_child(self.curr_view._grid)
-----

Currently window is using private members of child views, this solution will fix that too, as all views will have their own responsibility to go back.
Comment 3 Marinus Schraal 2017-12-19 11:57:26 UTC
Review of attachment 343458 [details] [review]:

lgtm
Comment 4 Marinus Schraal 2017-12-19 12:53:45 UTC
I really don't know why this lingered so long, added in commit 28a7c0868a6a0f116e6801afe22fad3b33a40e46 .

This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.