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 721194 - Back (return to overview) button not working after closing search bar in preview
Back (return to overview) button not working after closing search bar in preview
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
3.11.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
: 721165 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-12-29 09:54 UTC by Miha
Modified: 2014-01-08 17:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
searchbar: Disable entryChanged when not in the overview (1.12 KB, patch)
2014-01-02 11:51 UTC, Debarshi Ray
rejected Details | Review
embed: Ensure that the old toolbar is destroyed when changing modes (1.85 KB, patch)
2014-01-02 12:07 UTC, Debarshi Ray
none Details | Review
embed: Ensure that the old toolbar is destroyed when changing modes (1.48 KB, patch)
2014-01-08 14:30 UTC, Debarshi Ray
committed Details | Review

Description Miha 2013-12-29 09:54:18 UTC
After going through the following steps, the Back button in preview is no longer working:

1. Use search bar in overview to search for some document.
2. Click on (i.e. preview) one of the documents that match the search pattern.
3. In preview, search bar will be visible. Close it.
4. Try to go back to overview by clicking the Back button.

Actual behaviour: clicking on Back button has no effect. 

Expected behaviour: clicking on Back button should take you back to overview of the documents.
Comment 1 Debarshi Ray 2013-12-29 13:57:43 UTC
Amazing, who knew! Thanks for the details on how to reproduce it.
Comment 2 Debarshi Ray 2014-01-02 11:48:17 UTC
This is somewhat similar to bug 701252

1. For some reason the OverviewSearchbar is not destroyed when we move from OVERVIEW to PREVIEW. As far as I can make out the 'destroy' signal is never emitted, but it appears as if a new object is created every time the mode is changed. I do not know what is going on there. Looking at _prepareForOverview and _prepareForPreview, the old toolbar should be destroyed when it is replaced with a new one. Maybe we need to explicitly destroy it?

2. Since the OverviewSearchbar is still around in PREVIEW, its entryChanged is called when we toggle the search button to hide the searchbar.

3. That causes TrackerController to react to 'search-string-changed' which eventually leads to clearing the DocumentManager.

4. Therefore, when you hit the back button to go back to OVERVIEW, the active item is already NULL, and again setting it to NULL does not emit 'active-changed'.
Comment 3 Debarshi Ray 2014-01-02 11:51:46 UTC
Created attachment 265128 [details] [review]
searchbar: Disable entryChanged when not in the overview

This does not look right to me because the OverviewSearchbar should not around when we are not in OVERVIEW.
Comment 4 Debarshi Ray 2014-01-02 12:07:49 UTC
Created attachment 265129 [details] [review]
embed: Ensure that the old toolbar is destroyed when changing modes

This is another way to fix it by ensuring that the older toolbars are destroyed. This would also fix bug 721165
Comment 5 Debarshi Ray 2014-01-08 14:30:20 UTC
Created attachment 265706 [details] [review]
embed: Ensure that the old toolbar is destroyed when changing modes

This is actually a regression from 65e878570d44638812d346a5db0cf3bfd7589e7d
Comment 6 Debarshi Ray 2014-01-08 14:31:20 UTC
*** Bug 721165 has been marked as a duplicate of this bug. ***
Comment 7 Cosimo Cecchi 2014-01-08 17:20:36 UTC
Review of attachment 265706 [details] [review]:

I thought calling set_titlebar() again would destroy the original toolbar? Maybe we're keeping a reference to it from JS and that causes the widget not to be garbage collected immediately.
In any case, this looks good to me.
Comment 8 Debarshi Ray 2014-01-08 17:54:03 UTC
(In reply to comment #7)
> Review of attachment 265706 [details] [review]:
> 
> I thought calling set_titlebar() again would destroy the original toolbar?
> Maybe we're keeping a reference to it from JS and that causes the widget not to
> be garbage collected immediately.

Yeah, that is what I had assumed initially. Apparently not. :(
Comment 9 Debarshi Ray 2014-01-08 17:54:56 UTC
Comment on attachment 265706 [details] [review]
embed: Ensure that the old toolbar is destroyed when changing modes

Thanks for the review!