[gtk/kill-register-surface: 7/10] gtk-demo: Stop using gdk_surface_get_user_data
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/kill-register-surface: 7/10] gtk-demo: Stop using gdk_surface_get_user_data
- Date: Sat, 23 Feb 2019 23:58:21 +0000 (UTC)
commit 9fbb6478b29c4849dbf1517f685ee1cf9661abed
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Feb 23 16:54:51 2019 -0500
gtk-demo: Stop using gdk_surface_get_user_data
Use gtk_root_get_for_surface instead.
demos/gtk-demo/changedisplay.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/demos/gtk-demo/changedisplay.c b/demos/gtk-demo/changedisplay.c
index 4c36010e7b..5f5717c43d 100644
--- a/demos/gtk-demo/changedisplay.c
+++ b/demos/gtk-demo/changedisplay.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]