[gtk/wip/matthiasc/popup2: 28/51] label: Make default activation work in roots
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup2: 28/51] label: Make default activation work in roots
- Date: Mon, 18 Mar 2019 12:47:32 +0000 (UTC)
commit a9e2e055a05fe27636a825cb42d1a0aaa83acc2b
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Mar 3 20:10:06 2019 -0500
label: Make default activation work in roots
Use the GtkRoot API when activating the default widget.
This makes things work in GtkWindow and GtkPopup.
gtk/gtklabel.c | 26 ++------------------------
1 file changed, 2 insertions(+), 24 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index e3be68e02e..1722453818 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -6205,31 +6205,9 @@ gtk_label_activate_current_link (GtkLabel *label)
link = gtk_label_get_focus_link (label);
if (link)
- {
- emit_activate_link (label, link);
- }
+ emit_activate_link (label, link);
else
- {
- GtkWidget *toplevel;
- GtkWindow *window;
- GtkWidget *default_widget, *focus_widget;
-
- toplevel = gtk_widget_get_toplevel (widget);
- if (GTK_IS_WINDOW (toplevel))
- {
- window = GTK_WINDOW (toplevel);
-
- if (window)
- {
- default_widget = gtk_window_get_default_widget (window);
- focus_widget = gtk_root_get_focus (GTK_ROOT (window));
-
- if (default_widget != widget &&
- !(widget == focus_widget && (!default_widget || !gtk_widget_is_sensitive
(default_widget))))
- gtk_window_activate_default (window);
- }
- }
- }
+ gtk_root_activate_default (gtk_widget_get_root (widget));
}
static GtkLabelLink *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]