From cadd794d2cf127d3c8ad1668bd3016831dab79d6 Mon Sep 17 00:00:00 2001 From: Mohammed Sadiq Date: Sat, 11 Jul 2020 16:09:20 +0530 Subject: [PATCH] entry: Restrict magnifier popover within the entry size The magnifier shown with touch input should not go beyond the widget limits. --- gtk/gtkentry.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index b3424444a9..e3d512ba6f 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -4667,6 +4667,7 @@ gtk_entry_show_magnifier (GtkEntry *entry, _gtk_magnifier_set_coords (GTK_MAGNIFIER (priv->magnifier), rect.x, rect.y + rect.height / 2); + rect.x = CLAMP (rect.x, 0, allocation.width); gtk_popover_set_pointing_to (GTK_POPOVER (priv->magnifier_popover), &rect); gtk_popover_popup (GTK_POPOVER (priv->magnifier_popover));