[gtk/wip/baedert/for-master] window: Inline update_csd_shape() into only caller
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master] window: Inline update_csd_shape() into only caller
- Date: Wed, 5 Feb 2020 14:32:25 +0000 (UTC)
commit f43a7265baa26dbecd576260a0aca2326bb0db05
Author: Timm Bäder <mail baedert org>
Date: Wed Feb 5 15:31:10 2020 +0100
window: Inline update_csd_shape() into only caller
gtk/gtkwindow.c | 82 ++++++++++++++++++++++++++-------------------------------
1 file changed, 38 insertions(+), 44 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index e76fd3ae8a..fa880d5b51 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5313,49 +5313,6 @@ get_shadow_width (GtkWindow *window,
gtk_style_context_restore (context);
}
-static void
-update_csd_shape (GtkWindow *window)
-{
- GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
- GtkWidget *widget = (GtkWidget *)window;
- GtkCssBoxes css_boxes;
- graphene_rect_t border_box;
- GtkBorder handle_size;
-
- if (!priv->client_decorated)
- return;
-
- gtk_css_boxes_init (&css_boxes, priv->decoration_widget);
- border_box = *gtk_css_boxes_get_border_rect (&css_boxes);
-
- /* Move into window coords */
- if (!gtk_widget_compute_point (priv->decoration_widget, widget,
- &border_box.origin, &border_box.origin))
- return;
-
- get_resize_handle_size (window, &handle_size);
-
- if (priv->type != GTK_WINDOW_POPUP)
- {
- border_box.origin.x -= handle_size.left;
- border_box.origin.y -= handle_size.top;
- border_box.size.width += handle_size.left + handle_size.right;
- border_box.size.height += handle_size.top + handle_size.bottom;
- }
-
- if (border_box.size.width > 0 && border_box.size.height > 0)
- {
- cairo_region_t *region = cairo_region_create_rectangle (&(cairo_rectangle_int_t) {
- border_box.origin.x,
- border_box.origin.y,
- border_box.size.width,
- border_box.size.height
- });
- gtk_widget_set_csd_input_shape (widget, region);
- cairo_region_destroy (region);
- }
-}
-
static void
update_opaque_region (GtkWindow *window,
const GtkBorder *border,
@@ -5444,6 +5401,10 @@ update_realized_window_properties (GtkWindow *window,
GtkBorder *window_border)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
+ GtkWidget *widget = (GtkWidget *)window;
+ GtkCssBoxes css_boxes;
+ graphene_rect_t border_box;
+ GtkBorder handle_size;
if (priv->surface && priv->client_decorated && priv->use_client_shadow)
gdk_surface_set_shadow_width (priv->surface,
@@ -5453,7 +5414,40 @@ update_realized_window_properties (GtkWindow *window,
window_border->bottom);
update_opaque_region (window, window_border, child_allocation);
- update_csd_shape (window);
+
+ /* Update input shape */
+ if (!priv->client_decorated)
+ return;
+
+ gtk_css_boxes_init (&css_boxes, priv->decoration_widget);
+ border_box = *gtk_css_boxes_get_border_rect (&css_boxes);
+
+ /* Move into window coords */
+ if (!gtk_widget_compute_point (priv->decoration_widget, widget,
+ &border_box.origin, &border_box.origin))
+ return;
+
+ get_resize_handle_size (window, &handle_size);
+
+ if (priv->type != GTK_WINDOW_POPUP)
+ {
+ border_box.origin.x -= handle_size.left;
+ border_box.origin.y -= handle_size.top;
+ border_box.size.width += handle_size.left + handle_size.right;
+ border_box.size.height += handle_size.top + handle_size.bottom;
+ }
+
+ if (border_box.size.width > 0 && border_box.size.height > 0)
+ {
+ cairo_region_t *region = cairo_region_create_rectangle (&(cairo_rectangle_int_t) {
+ border_box.origin.x,
+ border_box.origin.y,
+ border_box.size.width,
+ border_box.size.height
+ });
+ gtk_widget_set_csd_input_shape (widget, region);
+ cairo_region_destroy (region);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]