[gtk/wip/baedert/for-master: 9/12] widget: Remove gtk_widget_input_shape_combine_region()



commit d5327a61e63b84fb68d2ad7ceceb4286d6f327d8
Author: Timm Bäder <mail baedert org>
Date:   Sat Feb 22 16:13:34 2020 +0100

    widget: Remove gtk_widget_input_shape_combine_region()
    
    Widget's don't have surfaces anymore these days.

 gtk/gtkwidget.c | 67 ---------------------------------------------------------
 gtk/gtkwidget.h |  6 ------
 2 files changed, 73 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 14cff1092c..944e6f303c 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -689,8 +689,6 @@ static void gtk_widget_set_usize_internal (GtkWidget          *widget,
 
 static gboolean event_surface_is_still_viewable (GdkEvent *event);
 
-static void gtk_widget_update_input_shape (GtkWidget *widget);
-
 static gboolean gtk_widget_class_get_visible_by_default (GtkWidgetClass *widget_class);
 
 static void remove_parent_surface_transform_changed_listener (GtkWidget *widget);
@@ -707,7 +705,6 @@ GtkTextDirection gtk_default_direction = GTK_TEXT_DIR_LTR;
 
 static GQuark          quark_accel_path = 0;
 static GQuark          quark_accel_closures = 0;
-static GQuark          quark_input_shape_info = 0;
 static GQuark          quark_pango_context = 0;
 static GQuark          quark_mnemonic_labels = 0;
 static GQuark          quark_tooltip_markup = 0;
@@ -864,7 +861,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
 
   quark_accel_path = g_quark_from_static_string ("gtk-accel-path");
   quark_accel_closures = g_quark_from_static_string ("gtk-accel-closures");
-  quark_input_shape_info = g_quark_from_static_string ("gtk-input-shape-info");
   quark_pango_context = g_quark_from_static_string ("gtk-pango-context");
   quark_mnemonic_labels = g_quark_from_static_string ("gtk-mnemonic-labels");
   quark_tooltip_markup = g_quark_from_static_string ("gtk-tooltip-markup");
@@ -3589,8 +3585,6 @@ gtk_widget_realize (GtkWidget *widget)
 
       g_signal_emit (widget, widget_signals[REALIZE], 0);
 
-      gtk_widget_update_input_shape (widget);
-
       if (priv->multidevice)
         {
           GdkSurface *surface = gtk_widget_get_surface (widget);
@@ -3627,9 +3621,6 @@ gtk_widget_unrealize (GtkWidget *widget)
   g_object_ref (widget);
   gtk_widget_push_verify_invariants (widget);
 
-  if (g_object_get_qdata (G_OBJECT (widget), quark_input_shape_info))
-    gtk_widget_input_shape_combine_region (widget, NULL);
-
   if (_gtk_widget_get_realized (widget))
     {
       if (priv->mapped)
@@ -8085,64 +8076,6 @@ gtk_widget_propagate_state (GtkWidget          *widget,
     }
 }
 
-static void
-gtk_widget_update_input_shape (GtkWidget *widget)
-{
-  GdkSurface *surface;
-
-  surface = gtk_widget_get_surface (widget);
-
-  /* set shape if widget has a GDK surface already.
-   * otherwise the shape is scheduled to be set by gtk_widget_realize().
-   */
-  if (surface)
-    {
-      cairo_region_t *region;
-      cairo_region_t *app_region;
-      gboolean free_region;
-
-      app_region = g_object_get_qdata (G_OBJECT (widget), quark_input_shape_info);
-
-      free_region = FALSE;
-
-      if (app_region)
-        region = app_region;
-      else
-        region = NULL;
-
-      gdk_surface_input_shape_combine_region (surface, region, 0, 0);
-
-      if (free_region)
-        cairo_region_destroy (region);
-    }
-}
-
-/**
- * gtk_widget_input_shape_combine_region:
- * @widget: a #GtkWidget
- * @region: (allow-none): shape to be added, or %NULL to remove an existing shape
- *
- * Sets an input shape for this widget’s GDK surface. This allows for
- * windows which react to mouse click in a nonrectangular region, see
- * gdk_surface_input_shape_combine_region() for more information.
- **/
-void
-gtk_widget_input_shape_combine_region (GtkWidget      *widget,
-                                       cairo_region_t *region)
-{
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  /*  set_shape doesn't work on widgets without GDK surface */
-  g_return_if_fail (GTK_IS_NATIVE (widget));
-
-  if (region == NULL)
-    g_object_set_qdata (G_OBJECT (widget), quark_input_shape_info, NULL);
-  else
-    g_object_set_qdata_full (G_OBJECT (widget), quark_input_shape_info,
-                             cairo_region_copy (region),
-                             (GDestroyNotify) cairo_region_destroy);
-  gtk_widget_update_input_shape (widget);
-}
-
 /**
  * gtk_requisition_new:
  *
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 92272125e8..9121d5bb7e 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -706,12 +706,6 @@ void             gtk_widget_set_default_direction (GtkTextDirection  dir);
 GDK_AVAILABLE_IN_ALL
 GtkTextDirection gtk_widget_get_default_direction (void);
 
-/* Counterpart to gdk_surface_input_shape_combine_region.
- */
-GDK_AVAILABLE_IN_ALL
-void         gtk_widget_input_shape_combine_region (GtkWidget *widget,
-                                                    cairo_region_t *region);
-
 GDK_AVAILABLE_IN_ALL
 void                    gtk_widget_set_cursor                   (GtkWidget              *widget,
                                                                  GdkCursor              *cursor);


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