[gtk/wip/baedert/for-master: 59/66] widget: Remove set_csd_input_shape



commit 757db03a326a80c1204bd5faa1de06c8815996a0
Author: Timm Bäder <mail baedert org>
Date:   Sat Feb 22 15:25:49 2020 +0100

    widget: Remove set_csd_input_shape
    
    Replace the only caller (unsurprisingly from gtkwindow.c) with a direct
    call to gdk_surface_input_shape_combine_region.

 gtk/gtkwidget.c        | 25 +------------------------
 gtk/gtkwidgetprivate.h |  3 ---
 gtk/gtkwindow.c        |  3 ++-
 3 files changed, 3 insertions(+), 28 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f2e3031f5c..77058c0358 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8145,25 +8145,15 @@ gtk_widget_update_input_shape (GtkWidget *widget)
   if (surface)
     {
       cairo_region_t *region;
-      cairo_region_t *csd_region;
       cairo_region_t *app_region;
       gboolean free_region;
 
       app_region = g_object_get_qdata (G_OBJECT (widget), quark_input_shape_info);
-      csd_region = g_object_get_data (G_OBJECT (widget), "csd-region");
 
       free_region = FALSE;
 
-      if (app_region && csd_region)
-        {
-          free_region = TRUE;
-          region = cairo_region_copy (app_region);
-          cairo_region_intersect (region, csd_region);
-        }
-      else if (app_region)
+      if (app_region)
         region = app_region;
-      else if (csd_region)
-        region = csd_region;
       else
         region = NULL;
 
@@ -8174,19 +8164,6 @@ gtk_widget_update_input_shape (GtkWidget *widget)
     }
 }
 
-void
-gtk_widget_set_csd_input_shape (GtkWidget            *widget,
-                                const cairo_region_t *region)
-{
-  if (region == NULL)
-    g_object_set_data (G_OBJECT (widget), "csd-region", NULL);
-  else
-    g_object_set_data_full (G_OBJECT (widget), "csd-region",
-                            cairo_region_copy (region),
-                            (GDestroyNotify) cairo_region_destroy);
-  gtk_widget_update_input_shape (widget);
-}
-
 /**
  * gtk_widget_input_shape_combine_region:
  * @widget: a #GtkWidget
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 00c3685d14..1018c9c915 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -279,9 +279,6 @@ gboolean          _gtk_widget_consumes_motion              (GtkWidget
 
 gboolean          gtk_widget_has_tick_callback             (GtkWidget *widget);
 
-void              gtk_widget_set_csd_input_shape           (GtkWidget            *widget,
-                                                            const cairo_region_t *region);
-
 gboolean          gtk_widget_has_size_request              (GtkWidget *widget);
 
 void              gtk_widget_reset_controllers             (GtkWidget *widget);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 0aa7583ffe..2f93d4ee9e 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5335,7 +5335,8 @@ update_csd_shape (GtkWindow *window)
   if (rect.width > 0 && rect.height > 0)
     {
       cairo_region_t *region = cairo_region_create_rectangle (&rect);
-      gtk_widget_set_csd_input_shape (widget, region);
+
+      gdk_surface_input_shape_combine_region (priv->surface, region, 0, 0);
       cairo_region_destroy (region);
     }
 }


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