diff options
author | Timm Bäder <mail@baedert.org> | 2018-07-08 09:29:14 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-07-08 09:41:15 +0200 |
commit | a976aa9740b90fd4e0ae5ac9086de2022fea4640 (patch) | |
tree | b88cd49778a97a0bcc7074ede690c63072f60286 /gtk/gtksearchbar.c | |
parent | 074eb2a19d6caff5b680fe9a4a8e8629e9e16e0a (diff) | |
download | gtk+-a976aa9740b90fd4e0ae5ac9086de2022fea4640.tar.gz |
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.
Diffstat (limited to 'gtk/gtksearchbar.c')
-rw-r--r-- | gtk/gtksearchbar.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c index 68bd94de3c..df91d8ef31 100644 --- a/gtk/gtksearchbar.c +++ b/gtk/gtksearchbar.c @@ -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; |