forked from AuroraMiddleware/gtk
searchbar: Ignore key presses when unmapped
The purpose of a searchbar is to start a search on visible widgets when a key is pressed. Starting a search on e.g. a stack page that is not visible at all is not very useful.
This commit is contained in:
parent
074eb2a19d
commit
a976aa9740
@ -640,6 +640,9 @@ capture_widget_key_handled (GtkEventControllerKey *controller,
|
||||
GtkSearchBarPrivate *priv = gtk_search_bar_get_instance_private (bar);
|
||||
gboolean handled;
|
||||
|
||||
if (!gtk_widget_get_mapped (GTK_WIDGET (bar)))
|
||||
return GDK_EVENT_PROPAGATE;
|
||||
|
||||
if (priv->reveal_child)
|
||||
return GDK_EVENT_PROPAGATE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user