gtk-demo: Stop using gtk_get_event_widget

This is convenience api that will be going away.
This commit is contained in:
Matthias Clasen 2020-02-20 21:27:26 -05:00
parent 497a43a4ba
commit 1c7191f45c

View File

@ -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);