summaryrefslogtreecommitdiff
path: root/gtk/gtkdragicon.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2020-02-22 04:49:52 +0100
committerBenjamin Otte <otte@redhat.com>2020-02-22 05:50:07 +0100
commitf656cbdc5b28f7855710598ccfaa4ad621c7eb91 (patch)
tree5fef657ba1d2c33eefa7e75e64421bb3a928347f /gtk/gtkdragicon.c
parent3eea9f3e797d04c91028d7ae4a30c18bfbfc5872 (diff)
downloadgtk+-f656cbdc5b28f7855710598ccfaa4ad621c7eb91.tar.gz
Ensure all natives request at least a 1px wide surface
FIXME: Is this necessary? Could the surfaces just clamp to 1x1 themselves? We recently declared that surfaces can decide on whatever size they want so natives need to inspect the size they requested anyway.
Diffstat (limited to 'gtk/gtkdragicon.c')
-rw-r--r--gtk/gtkdragicon.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gtk/gtkdragicon.c b/gtk/gtkdragicon.c
index 2e33f1c66c..e0b957bf56 100644
--- a/gtk/gtkdragicon.c
+++ b/gtk/gtkdragicon.c
@@ -129,7 +129,9 @@ gtk_drag_icon_move_resize (GtkDragIcon *icon)
if (icon->surface)
{
gtk_widget_get_preferred_size (GTK_WIDGET (icon), NULL, &req);
- gdk_surface_resize (icon->surface, req.width, req.height);
+ gdk_surface_resize (icon->surface,
+ MAX (1, req.width),
+ MAX (1, req.height));
}
}
@@ -256,8 +258,6 @@ gtk_drag_icon_size_allocate (GtkWidget *widget,
{
GtkDragIcon *icon = GTK_DRAG_ICON (widget);
- gtk_drag_icon_move_resize (icon);
-
if (icon->widget)
gtk_widget_allocate (icon->widget, width, height, baseline, NULL);
}