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



commit c24bf9b2e1daac1c1d8bc062b87c974cbff5cdb4
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 1dabd586c2..71df96c4b5 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8180,25 +8180,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;
 
@@ -8209,19 +8199,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 a15dceeffa..802bec0eab 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -285,9 +285,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 7b1c9c2f6d..818ddf3f23 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]