[gtk/wip/baedert/single-node-window: 481/485] window: Remove custom snapshot() implementation



commit 4ddb6bb34efa4b549550b35f9aa41a6995566bfa
Author: Timm Bäder <mail baedert org>
Date:   Sat May 2 08:40:27 2020 +0200

    window: Remove custom snapshot() implementation

 gtk/gtkwindow.c | 93 ---------------------------------------------------------
 1 file changed, 93 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index bc79bd3d28..5e3ca40275 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -774,7 +774,6 @@ gtk_window_class_init (GtkWindowClass *klass)
   widget_class->move_focus = gtk_window_move_focus;
   widget_class->state_flags_changed = gtk_window_state_flags_changed;
   widget_class->css_changed = gtk_window_css_changed;
-  widget_class->snapshot = gtk_window_snapshot;
 
   klass->activate_default = gtk_window_real_activate_default;
   klass->activate_focus = gtk_window_real_activate_focus;
@@ -6588,98 +6587,6 @@ gtk_window_compute_hints (GtkWindow   *window,
 #undef INCLUDE_CSD_SIZE
 #undef EXCLUDE_CSD_SIZE
 
-/***********************
- * Redrawing functions *
- ***********************/
-
-static void
-gtk_window_snapshot (GtkWidget   *widget,
-                     GtkSnapshot *snapshot)
-{
-  GtkWindowPrivate *priv = gtk_window_get_instance_private (GTK_WINDOW (widget));
-  GtkStyleContext *context;
-  GtkBorder window_border;
-  gint title_height;
-  int width, height;
-  GtkWidget *child;
-
-  context = gtk_widget_get_style_context (widget);
-
-  get_shadow_width (GTK_WINDOW (widget), &window_border);
-  width = gtk_widget_get_width (widget);
-  height = gtk_widget_get_height (widget);
-
-  if (priv->client_decorated &&
-      priv->decorated &&
-      !priv->fullscreen &&
-      !priv->maximized)
-    {
-      gtk_style_context_save_to_node (context, priv->decoration_node);
-
-      if (priv->use_client_shadow)
-        {
-          GtkBorder padding, border;
-
-          gtk_style_context_get_padding (context, &padding);
-          gtk_style_context_get_border (context, &border);
-          sum_borders (&border, &padding);
-
-          gtk_snapshot_render_background (snapshot, context,
-                                          window_border.left - border.left, window_border.top - border.top,
-                                          width -
-                                            (window_border.left + window_border.right - border.left - 
border.right),
-                                          height -
-                                            (window_border.top + window_border.bottom - border.top - 
border.bottom));
-          gtk_snapshot_render_frame (snapshot, context,
-                                     window_border.left - border.left, window_border.top - border.top,
-                                     width -
-                                       (window_border.left + window_border.right - border.left - 
border.right),
-                                     height -
-                                       (window_border.top + window_border.bottom - border.top - 
border.bottom));
-        }
-      else
-        {
-          gtk_snapshot_render_background (snapshot, context, 0, 0,
-                                          width, height);
-
-          gtk_snapshot_render_frame (snapshot, context, 0, 0,
-                                     width, height);
-        }
-      gtk_style_context_restore (context);
-    }
-
-  if (priv->title_box &&
-      gtk_widget_get_visible (priv->title_box) &&
-      gtk_widget_get_child_visible (priv->title_box))
-    title_height = priv->title_height;
-  else
-    title_height = 0;
-
-  gtk_snapshot_render_background (snapshot, context,
-                                  window_border.left,
-                                  window_border.top + title_height,
-                                  width -
-                                    (window_border.left + window_border.right),
-                                  height -
-                                    (window_border.top + window_border.bottom + title_height));
-  gtk_snapshot_render_frame (snapshot, context,
-                             window_border.left,
-                             window_border.top + title_height,
-                             width -
-                               (window_border.left + window_border.right),
-                             height -
-                               (window_border.top + window_border.bottom + title_height));
-
-  for (child = _gtk_widget_get_first_child (widget);
-       child != NULL;
-       child = _gtk_widget_get_next_sibling (child))
-    {
-      /* Handle popovers separately until their stacking order is fixed */
-      if (!GTK_IS_POPOVER (child))
-        gtk_widget_snapshot_child (widget, child, snapshot);
-    }
-}
-
 /**
  * gtk_window_present:
  * @window: a #GtkWindow


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