diff options
author | Benjamin Otte <otte@redhat.com> | 2018-03-21 03:42:34 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2018-03-21 04:10:07 +0100 |
commit | 0ce19eed083c79c5fb4091db3ecaf528346e610f (patch) | |
tree | 94c0b09b6ccd6bbbc45af8255e3fd5bf5d240118 /gtk | |
parent | ef693f317c0d3f21e6ec537400d3747c5457ea28 (diff) | |
download | gtk+-0ce19eed083c79c5fb4091db3ecaf528346e610f.tar.gz |
gdk: Remove gdk_surface_shape_combine_region()
If you want transparent region, you can just render them transparent.
If you want input shaping, use gdk_surface_input_shape_combine_region().
Also remove gtk_widget_shape_combine_region().
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkpopover.c | 4 | ||||
-rw-r--r-- | gtk/gtktreeview.c | 11 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 58 | ||||
-rw-r--r-- | gtk/gtkwidget.h | 3 | ||||
-rw-r--r-- | gtk/gtkwidgetprivate.h | 1 |
5 files changed, 2 insertions, 75 deletions
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index 0d26728cb3..f6faecc3e6 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -1040,10 +1040,10 @@ gtk_popover_update_shape (GtkPopover *popover) region = gdk_cairo_region_create_from_surface (surface); cairo_surface_destroy (surface); - gtk_widget_shape_combine_region (widget, region); + gtk_widget_input_shape_combine_region (widget, region); cairo_region_destroy (region); - gdk_surface_set_child_shapes (gtk_widget_get_surface (widget)); + gdk_surface_set_child_input_shapes (gtk_widget_get_surface (widget)); } static void diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 68613ea597..4dedb1c044 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -3594,7 +3594,6 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) GtkTreeViewColumnReorder *reorder = tree_view->priv->cur_reorder; GtkWidget *widget = GTK_WIDGET (tree_view); cairo_surface_t *mask_image; - cairo_region_t *mask_region; gint x; gint y; gint width; @@ -3717,11 +3716,6 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) cairo_fill (cr); cairo_destroy (cr); - mask_region = gdk_cairo_region_create_from_surface (mask_image); - gdk_surface_shape_combine_region (tree_view->priv->drag_highlight_window, - mask_region, 0, 0); - - cairo_region_destroy (mask_region); cairo_surface_destroy (mask_image); } @@ -3793,11 +3787,6 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) cairo_fill (cr); cairo_destroy (cr); - mask_region = gdk_cairo_region_create_from_surface (mask_image); - gdk_surface_shape_combine_region (tree_view->priv->drag_highlight_window, - mask_region, 0, 0); - - cairo_region_destroy (mask_region); cairo_surface_destroy (mask_image); } diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 38e1db7088..989b2d09d6 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -707,7 +707,6 @@ GtkTextDirection gtk_default_direction = GTK_TEXT_DIR_LTR; static GQuark quark_accel_path = 0; static GQuark quark_accel_closures = 0; static GQuark quark_parent_surface = 0; -static GQuark quark_shape_info = 0; static GQuark quark_input_shape_info = 0; static GQuark quark_pango_context = 0; static GQuark quark_mnemonic_labels = 0; @@ -925,7 +924,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_parent_surface = g_quark_from_static_string ("gtk-parent-surface"); - quark_shape_info = g_quark_from_static_string ("gtk-shape-info"); 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"); @@ -3871,7 +3869,6 @@ void gtk_widget_realize (GtkWidget *widget) { GtkWidgetPrivate *priv; - cairo_region_t *region; g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (widget->priv->anchored || @@ -3901,12 +3898,6 @@ gtk_widget_realize (GtkWidget *widget) gtk_widget_real_set_has_tooltip (widget, gtk_widget_get_has_tooltip (widget), TRUE); - if (priv->has_shape_mask) - { - region = g_object_get_qdata (G_OBJECT (widget), quark_shape_info); - gdk_surface_shape_combine_region (priv->surface, region, 0, 0); - } - gtk_widget_update_input_shape (widget); if (priv->multidevice) @@ -3939,9 +3930,6 @@ gtk_widget_unrealize (GtkWidget *widget) g_object_ref (widget); gtk_widget_push_verify_invariants (widget); - if (widget->priv->has_shape_mask) - gtk_widget_shape_combine_region (widget, NULL); - if (g_object_get_qdata (G_OBJECT (widget), quark_input_shape_info)) gtk_widget_input_shape_combine_region (widget, NULL); @@ -9719,52 +9707,6 @@ gtk_widget_propagate_state (GtkWidget *widget, } } -/** - * gtk_widget_shape_combine_region: - * @widget: a #GtkWidget - * @region: (allow-none): shape to be added, or %NULL to remove an existing shape - * - * Sets a shape for this widget’s GDK surface. This allows for - * transparent windows etc., see gdk_surface_shape_combine_region() - * for more information. - **/ -void -gtk_widget_shape_combine_region (GtkWidget *widget, - cairo_region_t *region) -{ - GtkWidgetPrivate *priv; - - g_return_if_fail (GTK_IS_WIDGET (widget)); - /* set_shape doesn't work on widgets without GDK surface */ - g_return_if_fail (_gtk_widget_get_has_surface (widget)); - - priv = widget->priv; - - if (region == NULL) - { - priv->has_shape_mask = FALSE; - - if (priv->surface) - gdk_surface_shape_combine_region (priv->surface, NULL, 0, 0); - - g_object_set_qdata (G_OBJECT (widget), quark_shape_info, NULL); - } - else - { - priv->has_shape_mask = TRUE; - - g_object_set_qdata_full (G_OBJECT (widget), quark_shape_info, - cairo_region_copy (region), - (GDestroyNotify) cairo_region_destroy); - - /* set shape if widget has a GDK surface already. - * otherwise the shape is scheduled to be set by gtk_widget_realize(). - */ - if (priv->surface) - gdk_surface_shape_combine_region (priv->surface, region, 0, 0); - } -} - static void gtk_widget_update_input_shape (GtkWidget *widget) { diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index 10fd37fd3d..093ffefc37 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -820,9 +820,6 @@ GtkTextDirection gtk_widget_get_default_direction (void); /* Counterpart to gdk_surface_shape_combine_region. */ GDK_AVAILABLE_IN_ALL -void gtk_widget_shape_combine_region (GtkWidget *widget, - cairo_region_t *region); -GDK_AVAILABLE_IN_ALL void gtk_widget_input_shape_combine_region (GtkWidget *widget, cairo_region_t *region); diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h index 509e76724e..dbe9ded71d 100644 --- a/gtk/gtkwidgetprivate.h +++ b/gtk/gtkwidgetprivate.h @@ -69,7 +69,6 @@ struct _GtkWidgetPrivate guint shadowed : 1; guint child_visible : 1; guint multidevice : 1; - guint has_shape_mask : 1; guint pass_through : 1; /* Queue-resize related flags */ |