[gtk/readonly-events-1: 147/149] gtk-demo: Stop using gtk_get_event_widget



commit 1c7191f45cdc60765d8d5118deb91c13dd9b2b65
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Feb 20 21:27:26 2020 -0500

    gtk-demo: Stop using gtk_get_event_widget
    
    This is convenience api that will be going away.

 demos/gtk-demo/popover.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/demos/gtk-demo/popover.c b/demos/gtk-demo/popover.c
index 860df60416..2d5c44cf59 100644
--- a/demos/gtk-demo/popover.c
+++ b/demos/gtk-demo/popover.c
@@ -99,6 +99,7 @@ day_selected_cb (GtkCalendar *calendar,
   GtkWidget *popover;
   GdkEvent *event;
   gdouble x, y;
+  GtkWidget *widget;
 
   event = gtk_get_current_event ();
 
@@ -106,7 +107,8 @@ day_selected_cb (GtkCalendar *calendar,
     return;
 
   gdk_event_get_position (event, &x, &y);
-  gtk_widget_translate_coordinates (gtk_get_event_widget (event),
+  widget = gtk_native_get_for_surface (gdk_event_get_surface (event));
+  gtk_widget_translate_coordinates (widget,
                                     GTK_WIDGET (calendar),
                                     x, y,
                                     &rect.x, &rect.y);


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