mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-16 07:04:29 +00:00
inspector: Stop using gdk_surface_get_user_data
Use gtk_root_get_for_surface instead.
This commit is contained in:
parent
12663d2844
commit
704e377fae
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user