[gtk/wip/matthiasc/popup4: 82/140] Drop gtk_widget_register_surface



commit 62633437659eb4629560cd0310e44d7ce5b195ac
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 33f5984760..df2e305f71 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4490,8 +4490,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 d3d926e406..acebd0d47c 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 26bcbb040a..02d1a4b3ed 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8519,7 +8519,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;
     }
@@ -11554,77 +11553,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 9b17b56845..f737af6ccd 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -567,12 +567,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]