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 732416 - grid search results are truncated when modifying search terms
grid search results are truncated when modifying search terms
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: search
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 710531 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-06-29 11:25 UTC by Alban Browaeys
Modified: 2014-07-19 21:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Search: Don't use IconGrid width for maxDisplayedResults (2.94 KB, patch)
2014-06-29 12:28 UTC, Carlos Soriano
none Details | Review
Search: Don't use IconGrid width for maxDisplayedResults (3.08 KB, patch)
2014-07-15 15:13 UTC, Carlos Soriano
committed Details | Review

Description Alban Browaeys 2014-06-29 11:25:38 UTC
The search when in grid mode (AppSearchResults for one) initially returns all results, then if one do a search that returns no results, then fix its terms, the results will be truncated to one of them.


Steps to reproduce:
1. search with results (here "d"for AppDisplay)
2. search with no results (here "dx"as term ),
3. search from step 1 - this time I only see one result - (here "d"),
4. a search with no results (here "dx" again),
5. same search as in step 1 and 3 - this time I get all the results as in step 1 - (here "d")

_getMaxDisplayedResults is called only in 1, 3 and 5 . It is this value that down the filterResults to one item in step "3" as it computes the number of results from  the width of the GridSearchResults._bin parent of the IconGrid.

This bin width down when the IconGrid has no children to expand inside of it (ie the _clearResultDisplay if GridSearchResults is called from the updateSearch).

PS: The IconGrid _getPreferredWidth returned alloc.min_size has an issue in that it returns too big a size when no child is there any more (ie 136 instead of 0).
Thus the _getMaxDisplayedResults ends up as value 1 instead (with above 0 instead of 136 it would be zero returned as max). Still it is bad a value, only one result is displayed.
Comment 1 Carlos Soriano 2014-06-29 12:28:36 UTC
Created attachment 279525 [details] [review]
Search: Don't use IconGrid width for maxDisplayedResults

Currently to know how many results we could show for GridResults
we use the width of the bin containing those results. Since it's
expanding it shouldn't be a problem. But it becomes a problem when
no results are displayed, thus the IconGrid becomes 0 width, and
therefore the bin becomes 0 width too.
In the next introduction of terms in search we call again
maxDisplayedResults with a width of 0, and therefore no results are
displayed (currently a bug on IconGrid makes the min size = one icon,
so actually we show one and only one icon in this case).

To solve that use the parent container which contains the search results
of all providers or the text label with not displayed results, so it
always have the real available width to calculate
maxDisplayedResults.

Thanks Alban Browaeys for the debugging footwork.
Comment 2 Carlos Soriano 2014-06-29 12:31:02 UTC
To be honest couldn't find why it was working before in the first search call, since IconGrid has no children and therefore preferred_width is 0 and therefore the container bin should be 0. Instead of that the debug results was that the first time the container bin had the parent width and therefore was working fine.
Comment 3 Carlos Soriano 2014-07-15 15:13:26 UTC
Created attachment 280724 [details] [review]
Search: Don't use IconGrid width for maxDisplayedResults

Currently to know how many results we could show for GridResults
we use the width of the bin containing those results. Since it's
expanding it shouldn't be a problem. But it becomes a problem when
no results are displayed, thus the container becomes hidden and
it losts its allocation.
In the next introduction of terms in search we call again
maxDisplayedResults but it doesn't have allocation yet, and therefore no
results are displayed (currently a bug on IconGrid makes the min size =
one icon, so actually we show one and only one icon in this case).

To solve that use the parent container which contains the search results
of all providers or the text label with not displayed results, so it
always have the real available width to calculate maxDisplayedResults.

Thanks Alban Browaeys for the debugging footwork.
Comment 4 Jasper St. Pierre (not reading bugmail) 2014-07-16 13:53:53 UTC
Review of attachment 280724 [details] [review]:

Looks good.
Comment 5 Carlos Soriano 2014-07-19 16:13:12 UTC
Attachment 280724 [details] pushed as 9970671 - Search: Don't use IconGrid width for maxDisplayedResults
Comment 6 Michael Catanzaro 2014-07-19 21:02:21 UTC
*** Bug 710531 has been marked as a duplicate of this bug. ***