gtk-demo: Stop using gdk_surface_get_user_data
Use gtk_root_get_for_surface instead.
This commit is contained in:
@@ -71,20 +71,12 @@ find_toplevel_at_pointer (GdkDisplay *display)
|
||||
GdkSurface *pointer_window;
|
||||
GtkWidget *widget = NULL;
|
||||
|
||||
pointer_window = gdk_device_get_surface_at_position (gtk_get_current_event_device (),
|
||||
NULL, NULL);
|
||||
pointer_window = gdk_device_get_surface_at_position (gtk_get_current_event_device (), NULL, NULL);
|
||||
|
||||
/* The user data field of a GdkSurface is used to store a pointer
|
||||
* to the widget that created it.
|
||||
*/
|
||||
if (pointer_window)
|
||||
{
|
||||
gpointer widget_ptr;
|
||||
gdk_surface_get_user_data (pointer_window, &widget_ptr);
|
||||
widget = widget_ptr;
|
||||
}
|
||||
widget = GTK_WIDGET (gtk_root_get_for_surface (pointer_window));
|
||||
|
||||
return widget ? gtk_widget_get_toplevel (widget) : NULL;
|
||||
return widget;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user