[gtk/wip/otte/dnd: 138/144] native: Make all natives request at least 1px



commit 2172d82a442fab1050a722d8963166f9b0f76186
Author: Benjamin Otte <otte redhat com>
Date:   Sat Feb 22 02:46:53 2020 +0100

    native: Make all natives request at least 1px
    
    They need to create surfaces of at least 1px width, so better request at
    least that much space.

 gtk/gtkdragicon.c      | 3 +++
 gtk/gtkpopover.c       | 2 ++
 gtk/gtktooltipwindow.c | 3 +++
 gtk/gtkwindow.c        | 3 +++
 4 files changed, 11 insertions(+)
---
diff --git a/gtk/gtkdragicon.c b/gtk/gtkdragicon.c
index 2e33f1c66c..5f745dfe55 100644
--- a/gtk/gtkdragicon.c
+++ b/gtk/gtkdragicon.c
@@ -246,6 +246,9 @@ gtk_drag_icon_measure (GtkWidget      *widget,
                         orientation, for_size,
                         minimum, natural,
                         minimum_baseline, natural_baseline);
+
+  *minimum = MAX (*minimum, 1);
+  *natural = MAX (*natural, 1);
 }
 
 static void
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 7c202414ee..efd9c1f2d6 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -1198,6 +1198,8 @@ get_minimal_size (GtkPopover     *popover,
       (orientation == GTK_ORIENTATION_VERTICAL && !POS_IS_VERTICAL (pos)))
     minimal_size += tail_gap_width;
 
+  minimal_size = MAX (minimal_size, 1);
+
   return minimal_size;
 }
 
diff --git a/gtk/gtktooltipwindow.c b/gtk/gtktooltipwindow.c
index 4af7fc613d..b50c9344c0 100644
--- a/gtk/gtktooltipwindow.c
+++ b/gtk/gtktooltipwindow.c
@@ -350,6 +350,9 @@ gtk_tooltip_window_measure (GtkWidget      *widget,
                         orientation, for_size,
                         minimum, natural,
                         minimum_baseline, natural_baseline);
+
+  *minimum = MAX (*minimum, 1);
+  *natural = MAX (*natural, 1);
 }
 
 static void
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 7b1c9c2f6d..d7ff2a61a6 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -716,6 +716,9 @@ gtk_window_measure (GtkWidget      *widget,
       *minimum = title_min_size + child_min_size + window_border.top + window_border.bottom;
       *natural = title_nat_size + child_nat_size + window_border.top + window_border.bottom;
     }
+
+  *minimum = MAX (*minimum, 1);
+  *natural = MAX (*natural, 1);
 }
 
 static void


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