[gtk/wip/matthiasc/popup5: 96/128] popover: Only grab focus when modal
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup5: 96/128] popover: Only grab focus when modal
- Date: Sat, 18 May 2019 16:25:47 +0000 (UTC)
commit 6f51a791e52930b94f03762915b2aff04249f5a7
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Apr 30 01:55:01 2019 +0000
popover: Only grab focus when modal
This matches the previous behavior, and is
needed to make emoji completion and similar
use cases work.
gtk/gtkpopover.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 3bf17fc071..cd63c134c8 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -513,14 +513,20 @@ gtk_popover_move_focus (GtkWidget *widget,
static void
gtk_popover_show (GtkWidget *widget)
{
+ GtkPopover *popover = GTK_POPOVER (widget);
+ GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
+
_gtk_widget_set_visible_flag (widget, TRUE);
gtk_css_node_validate (gtk_widget_get_css_node (widget));
gtk_widget_realize (widget);
gtk_popover_native_check_resize (GTK_NATIVE (widget));
gtk_widget_map (widget);
- if (!gtk_widget_get_focus_child (widget))
- gtk_widget_child_focus (widget, GTK_DIR_TAB_FORWARD);
+ if (priv->modal)
+ {
+ if (!gtk_widget_get_focus_child (widget))
+ gtk_widget_child_focus (widget, GTK_DIR_TAB_FORWARD);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]