[gtk/wip/matthiasc/focus2: 6/32] window: Implement the root focus api
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/focus2: 6/32] window: Implement the root focus api
- Date: Sun, 3 Mar 2019 19:09:03 +0000 (UTC)
commit faf3357102f127dfb37486504f2206d545f0bb46
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Mar 2 08:46:21 2019 -0500
window: Implement the root focus api
This just uses the existing get/set_focus functions.
We keep them public for now.
gtk/gtkwindow.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 10e80d195d..87c3aa6927 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -2533,12 +2533,31 @@ gtk_window_root_get_surface_transform (GtkRoot *root,
*y = margin.top + border.top + padding.top;
}
+static void
+gtk_window_root_set_focus (GtkRoot *root,
+ GtkWidget *focus)
+{
+ GtkWindow *self = GTK_WINDOW (root);
+
+ gtk_window_set_focus (self, focus);
+}
+
+static GtkWidget *
+gtk_window_root_get_focus (GtkRoot *root)
+{
+ GtkWindow *self = GTK_WINDOW (root);
+
+ return gtk_window_get_focus (self);
+}
+
static void
gtk_window_root_interface_init (GtkRootInterface *iface)
{
iface->get_display = gtk_window_root_get_display;
iface->get_renderer = gtk_window_root_get_renderer;
iface->get_surface_transform = gtk_window_root_get_surface_transform;
+ iface->set_focus = gtk_window_root_set_focus;
+ iface->get_focus = gtk_window_root_get_focus;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]