inspector: Stop using gdk_surface_get_user_data

Use gtk_root_get_for_surface instead.
This commit is contained in:
Matthias Clasen 2019-02-23 16:51:51 -05:00
parent 12663d2844
commit 704e377fae

View File

@ -36,6 +36,7 @@
#include "gtkgesturemultipress.h"
#include "gtkeventcontrollermotion.h"
#include "gtkeventcontrollerkey.h"
#include "gtkroot.h"
static GtkWidget *
find_widget_at_pointer (GdkDevice *device)
@ -46,31 +47,7 @@ find_widget_at_pointer (GdkDevice *device)
pointer_surface = gdk_device_get_surface_at_position (device, NULL, NULL);
if (pointer_surface)
{
gpointer widget_ptr;
gdk_surface_get_user_data (pointer_surface, &widget_ptr);
widget = widget_ptr;
if (!GTK_IS_WINDOW (widget))
{
while (TRUE)
{
GdkSurface *parent = gdk_surface_get_parent (pointer_surface);
if (!parent)
break;
pointer_surface = parent;
gdk_surface_get_user_data (pointer_surface, &widget_ptr);
widget = widget_ptr;
if (GTK_IS_WINDOW (widget))
break;
}
}
}
widget = gtk_root_get_for_surface (pointer_surface);
if (widget)
{