Commit 8cf231c3 authored by Matthias Clasen's avatar Matthias Clasen

window: No need to keep the key controller

We don't need access to it after creating it.
parent 2cd739ae
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment