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 725861 - Search loses focus after filter is added
Search loses focus after filter is added
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
3.11.x
Other All
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-03-06 23:07 UTC by Kat
Modified: 2014-03-15 18:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
_searchEntry is refocused after a filter is selected (1.06 KB, patch)
2014-03-11 14:02 UTC, Rohit Agarwal
accepted-commit_now Details | Review
searchbar: Refocus the search entry after changing filters (851 bytes, patch)
2014-03-15 14:50 UTC, Debarshi Ray
committed Details | Review

Description Kat 2014-03-06 23:07:22 UTC
When filtering the search, I expect to be able to select the filter, then start typing the search term. At the moment, the search field is not re-focused after a filter is selected.
Comment 1 Rohit Agarwal 2014-03-11 14:02:04 UTC
Created attachment 271521 [details] [review]
_searchEntry is refocused after a filter is selected
Comment 2 Cosimo Cecchi 2014-03-11 22:54:43 UTC
Review of attachment 271521 [details] [review]:

Thanks for the patch, Rohit! This looks good to me, except for the following minor comment.

::: src/searchbar.js
@@ +368,3 @@
+
+        if (eventDevice)
+            Gd.entry_focus_hack(this._searchEntry, eventDevice);

Do you really need to check for a != null device before passing it down? I think the code is robust to a null device there.
Comment 3 Debarshi Ray 2014-03-12 10:01:56 UTC
(In reply to comment #2)
> Review of attachment 271521 [details] [review]:

> ::: src/searchbar.js
> @@ +368,3 @@
> +
> +        if (eventDevice)
> +            Gd.entry_focus_hack(this._searchEntry, eventDevice);
> 
> Do you really need to check for a != null device before passing it down? I
> think the code is robust to a null device there.

gd_entry_focus_hack does not look out for NULL devices. Passing a NULL device will lead to:
    fevent = gdk_event_new (GDK_FOCUS_CHANGE);
    gdk_event_set_device (fevent, NULL);

And if we look higher up in the same file Searchbar.show has a similar chunk of code.
Comment 4 Cosimo Cecchi 2014-03-12 18:27:28 UTC
Review of attachment 271521 [details] [review]:

Oops, you're right :-)
Disregard that comment then - this looks good to me.
Comment 5 Rohit Agarwal 2014-03-15 14:40:46 UTC
(In reply to comment #4)
> Review of attachment 271521 [details] [review]:
> 
> Oops, you're right :-)
> Disregard that comment then - this looks good to me.

Thanks for reviewing it. Can you please commit it for me ?
Comment 6 Debarshi Ray 2014-03-15 14:43:52 UTC
Review of attachment 271521 [details] [review]:

::: src/searchbar.js
@@ +364,3 @@
             this._searchEntry.add_tag(tag);
         }
+        

Trailing whitespace alert!
Comment 7 Debarshi Ray 2014-03-15 14:50:22 UTC
Created attachment 272015 [details] [review]
searchbar: Refocus the search entry after changing filters

Committed it after removing the trailing whitespace and making sure that the commit message is not wider than 72 characters.
Comment 8 Debarshi Ray 2014-03-15 14:50:45 UTC
Thanks for the awesome patch, Rohit!
Comment 9 Rohit Agarwal 2014-03-15 18:02:31 UTC
(In reply to comment #8)
> Thanks for the awesome patch, Rohit!

thanks :)