[gtk/wip/otte/dnd: 10/21] widget: Don't check for natives



commit 612ba7ec15aa985673e038ed9caa7a3e89418d48
Author: Benjamin Otte <otte redhat com>
Date:   Sat Feb 22 02:47:41 2020 +0100

    widget: Don't check for natives
    
    It's the native's job to request a 1px x 1px size, not the job of
    gtk_widget_size_allocate()
    
    Also saves 10% of size_allocate() time because checking for an interface
    is really expensive.

 gtk/gtkwidget.c | 6 ------
 1 file changed, 6 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 40663ddb45..f41b54b390 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4046,12 +4046,6 @@ gtk_widget_allocate (GtkWidget    *widget,
       adjusted.height = 0;
     }
 
-  if (G_UNLIKELY (GTK_IS_NATIVE (widget)))
-    {
-      adjusted.width = MAX (1, adjusted.width);
-      adjusted.height = MAX (1, adjusted.height);
-    }
-
   style = gtk_css_node_get_style (priv->cssnode);
   get_box_margin (style, &margin);
   get_box_border (style, &border);


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