[gtk/shortcuts-rebased-again: 162/171] window: No need to keep the key controller
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/shortcuts-rebased-again: 162/171] window: No need to keep the key controller
- Date: Mon, 24 Jun 2019 23:18:06 +0000 (UTC)
commit 8cf231c3b790ed2d2dc3aac70ab0ab7c52ccda8c
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jun 24 02:46:56 2019 +0000
window: No need to keep the key controller
We don't need access to it after creating it.
gtk/gtkwindow.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index be60f21c08..56ded34521 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -269,7 +269,6 @@ typedef struct
GtkGesture *click_gesture;
GtkGesture *drag_gesture;
GtkGesture *bubble_drag_gesture;
- GtkEventController *key_controller;
GtkEventController *application_shortcut_controller;
GdkSurface *hardcoded_surface;
@@ -1871,18 +1870,18 @@ gtk_window_init (GtkWindow *window)
G_CALLBACK (gtk_window_capture_motion), window);
gtk_widget_add_controller (widget, controller);
- priv->key_controller = gtk_event_controller_key_new ();
- gtk_event_controller_set_propagation_phase (priv->key_controller, GTK_PHASE_CAPTURE);
- gtk_event_controller_set_name (priv->key_controller, "window focus");
- g_signal_connect_swapped (priv->key_controller, "focus-in",
+ controller = gtk_event_controller_key_new ();
+ gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_CAPTURE);
+ gtk_event_controller_set_name (controller, "window focus");
+ g_signal_connect_swapped (controller, "focus-in",
G_CALLBACK (gtk_window_focus_in), window);
- g_signal_connect_swapped (priv->key_controller, "focus-out",
+ g_signal_connect_swapped (controller, "focus-out",
G_CALLBACK (gtk_window_focus_out), window);
- g_signal_connect_swapped (priv->key_controller, "key-pressed",
+ g_signal_connect_swapped (controller, "key-pressed",
G_CALLBACK (gtk_window_key_pressed), window);
- g_signal_connect_swapped (priv->key_controller, "key-released",
+ g_signal_connect_swapped (controller, "key-released",
G_CALLBACK (gtk_window_key_released), window);
- gtk_widget_add_controller (widget, priv->key_controller);
+ gtk_widget_add_controller (widget, controller);
controller = gtk_shortcut_controller_new ();
gtk_event_controller_set_name (controller, "window menubar");
@@ -6073,6 +6072,7 @@ gtk_window_set_focus (GtkWindow *window,
g_return_if_fail (GTK_IS_WINDOW (window));
+g_print ("window set focus: %s\n", focus ? gtk_widget_get_name (focus):"");
if (focus && !gtk_widget_is_sensitive (focus))
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]