[gtk/kill-register-surface: 9/10] fixups



commit 33d5ec2895b02f7ce49f0b5ca9e45d7eb782ee40
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Feb 23 18:55:48 2019 -0500

    fixups

 gtk/gtkroot.c          |  1 +
 gtk/gtkwidget.c        | 11 ++++-------
 gtk/gtkwidgetprivate.h |  2 +-
 3 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkroot.c b/gtk/gtkroot.c
index 158e7cb1df..afe527ed30 100644
--- a/gtk/gtkroot.c
+++ b/gtk/gtkroot.c
@@ -20,6 +20,7 @@
 #include "config.h"
 
 #include "gtkrootprivate.h"
+#include "gtkwidgetprivate.h"
 
 /**
  * SECTION:root
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 51fed0c135..c7ab055c08 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -11432,7 +11432,7 @@ gtk_widget_for_surface (GdkSurface *surface)
 {
   gpointer user_data;
 
-  user_data = g_object_get_qdata (surface, quark_surface_widget);
+  user_data = g_object_get_qdata (G_OBJECT (surface), quark_surface_widget);
   if (user_data)
     return GTK_WIDGET (user_data);
 
@@ -11461,7 +11461,7 @@ gtk_widget_register_surface (GtkWidget    *widget,
   g_return_if_fail (GDK_IS_SURFACE (surface));
 
   g_assert (gtk_widget_for_surface (surface) == NULL);
-  g_object_set_qdata (surface, quark_surface_widget, widget);
+  g_object_set_qdata (G_OBJECT (surface), quark_surface_widget, widget);
 
   g_signal_connect (surface, "render", G_CALLBACK (surface_expose), widget);
   g_signal_connect (surface, "event", G_CALLBACK (surface_event), widget);
@@ -11480,14 +11480,11 @@ void
 gtk_widget_unregister_surface (GtkWidget    *widget,
                               GdkSurface    *surface)
 {
-  gpointer user_data;
-
   g_return_if_fail (GTK_IS_WIDGET (widget));
   g_return_if_fail (GDK_IS_SURFACE (surface));
 
-  user_data = g_object_get_qdata (surface, quark_surface_widget);
-  g_assert (user_data == widget);
-  g_object_set_qdata (surface, quark_surface_widget, NULL);
+  g_assert (gtk_widget_for_surface (surface) == widget);
+  g_object_set_qdata (G_OBJECT (surface), quark_surface_widget, NULL);
 
   g_signal_handlers_disconnect_by_func (surface, surface_expose, widget);
   g_signal_handlers_disconnect_by_func (surface, surface_event, widget);
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index af9709a814..46defb44fe 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -337,7 +337,7 @@ gboolean          gtk_widget_run_controllers               (GtkWidget
                                                             const GdkEvent      *event,
                                                             GtkPropagationPhase  phase);
 
-gpointer          gtk_widget_for_surface                   (GdkSurface *surface);
+GtkWidget *       gtk_widget_for_surface                   (GdkSurface *surface);
 
 /* inline getters */
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]