[gtk/wip/matthiasc/popup5: 73/118] Drop gtk_widget_register_surface



commit 3b1a4cf403dc8d64472cd2f3380cbb0215c91040
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Apr 19 16:18:57 2019 -0400

    Drop gtk_widget_register_surface
    
    This is no longer used.

 docs/reference/gtk/gtk4-sections.txt  |  2 -
 docs/reference/gtk/input-handling.xml |  3 +-
 gtk/gtkwidget.c                       | 72 -----------------------------------
 gtk/gtkwidget.h                       |  6 ---
 4 files changed, 1 insertion(+), 82 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 308299e8de..bb9dcb5167 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4488,8 +4488,6 @@ gtk_widget_get_has_tooltip
 gtk_widget_set_has_tooltip
 gtk_widget_trigger_tooltip_query
 gtk_widget_get_surface
-gtk_widget_register_surface
-gtk_widget_unregister_surface
 gtk_widget_get_allocated_width
 gtk_widget_get_allocated_height
 gtk_widget_get_allocation
diff --git a/docs/reference/gtk/input-handling.xml b/docs/reference/gtk/input-handling.xml
index 3895e4a269..f81252dfbb 100644
--- a/docs/reference/gtk/input-handling.xml
+++ b/docs/reference/gtk/input-handling.xml
@@ -104,8 +104,7 @@
       a #GdkSurface, which in turn represents a windowing system surface in the
       backend. If a widget has grabbed the current input device, or all input
       devices, the event is propagated to that #GtkWidget. Otherwise, it is
-      propagated to the the #GtkWidget which called gtk_widget_register_surface()
-      on the #GdkSurface receiving the event.
+      propagated to the the #GtkRoot which owns the #GdkSurface receiving the event.
     </para>
 
     <para>
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index a9cd83a20b..2b7f51a54d 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8322,7 +8322,6 @@ gtk_widget_real_unrealize (GtkWidget *widget)
 
   if (_gtk_widget_get_has_surface (widget))
     {
-      gtk_widget_unregister_surface (widget, priv->surface);
       gdk_surface_destroy (priv->surface);
       priv->surface = NULL;
     }
@@ -11324,77 +11323,6 @@ gtk_widget_set_surface (GtkWidget *widget,
     }
 }
 
-static gboolean
-surface_expose (GdkSurface     *surface,
-                cairo_region_t *region,
-                GtkWidget      *widget)
-{
-  gtk_widget_render (widget, surface, region);
-
-  return TRUE;
-}
-
-static gboolean
-surface_event (GdkSurface *surface,
-               GdkEvent   *event,
-               GtkWidget  *widget)
-{
-  gtk_main_do_event (event);
-
-  return TRUE;
-}
-
-/**
- * gtk_widget_register_surface:
- * @widget: a #GtkWidget
- * @surface: a #GdkSurface
- *
- * Registers a #GdkSurface with the widget and sets it up so that
- * the widget receives events for it. Call gtk_widget_unregister_surface()
- * when destroying the surface.
- *
- * Before 3.8 you needed to call gdk_surface_set_user_data() directly to set
- * this up. This is now deprecated and you should use gtk_widget_register_surface()
- * instead. Old code will keep working as is, although some new features like
- * transparency might not work perfectly.
- */
-void
-gtk_widget_register_surface (GtkWidget    *widget,
-                            GdkSurface    *surface)
-{
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail (GDK_IS_SURFACE (surface));
-
-  g_assert (gdk_surface_get_widget (surface) == NULL);
-  gdk_surface_set_widget (surface, widget);
-
-  g_signal_connect (surface, "render", G_CALLBACK (surface_expose), widget);
-  g_signal_connect (surface, "event", G_CALLBACK (surface_event), widget);
-}
-
-/**
- * gtk_widget_unregister_surface:
- * @widget: a #GtkWidget
- * @surface: a #GdkSurface
- *
- * Unregisters a #GdkSurface from the widget that was previously set up with
- * gtk_widget_register_surface(). You need to call this when the surface is
- * no longer used by the widget, such as when you destroy it.
- */
-void
-gtk_widget_unregister_surface (GtkWidget    *widget,
-                              GdkSurface    *surface)
-{
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail (GDK_IS_SURFACE (surface));
-
-  g_assert (gdk_surface_get_widget (surface) == widget);
-  gdk_surface_set_widget (surface, NULL);
-
-  g_signal_handlers_disconnect_by_func (surface, surface_expose, widget);
-  g_signal_handlers_disconnect_by_func (surface, surface_event, widget);
-}
-
 /**
  * gtk_widget_get_surface:
  * @widget: a #GtkWidget
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 6961f20794..0a9aee1dd3 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -555,12 +555,6 @@ void                  gtk_widget_set_surface            (GtkWidget    *widget,
                                                          GdkSurface    *surface);
 GDK_AVAILABLE_IN_ALL
 GdkSurface           * gtk_widget_get_surface           (GtkWidget    *widget);
-GDK_AVAILABLE_IN_ALL
-void                  gtk_widget_register_surface       (GtkWidget    *widget,
-                                                         GdkSurface    *surface);
-GDK_AVAILABLE_IN_ALL
-void                  gtk_widget_unregister_surface     (GtkWidget    *widget,
-                                                         GdkSurface    *surface);
 
 GDK_AVAILABLE_IN_ALL
 int                   gtk_widget_get_allocated_width    (GtkWidget     *widget);


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