Skip to content

searchbar: Don't activate type-to-search when focusing entries

Alice Mikhaylenko requested to merge wip/exalm/searchbar into master

Currently using GtkSearchBar:key-capture-widget steals focus from unrelated entries within the key capture widget, which is a common case when the key capture widget is the window containing the search bar.

In theory it can be fixed by switching the propagation phase to bubble, but there's a good chance that keypresses will then be intercepted by some other widget when not wanted.

So, instead do a hack and check the type of the focused widget, skipping if it's a GtkEditable or GtkTextView, and additionally has the editable property set to TRUE.

Fixes #3606 (closed)

Screenshot_from_2021-01-20_16-30-37

CC @carlosg

Merge request reports