[gtk/readonly-events-1: 33/74] window: Use event constructors



commit e3b0b8f8fdf32fb998799eb50589bbead83d7f09
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Feb 15 10:13:19 2020 -0500

    window: Use event constructors

 gtk/gtkwindow.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 37836d360f..1f228bae32 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6387,12 +6387,7 @@ gtk_window_set_focus (GtkWindow *window,
   seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (window)));
   device = gdk_seat_get_keyboard (seat);
 
-  event = gdk_event_new (GDK_FOCUS_CHANGE);
-  gdk_event_set_display (event, gtk_widget_get_display (GTK_WIDGET (window)));
-  gdk_event_set_device (event, device);
-  event->any.surface = priv->surface;
-  if (event->any.surface)
-    g_object_ref (event->any.surface);
+  event = gdk_event_focus_new (priv->surface, device, device, TRUE);
 
   gtk_synthesize_crossing_events (GTK_ROOT (window), old_focus, focus, event, GDK_CROSSING_NORMAL);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]