From d0ebd42e3ee2a716b9b76db3d96a786e9ba54e45 Mon Sep 17 00:00:00 2001 From: Daniel Boles Date: Sun, 11 Jun 2023 11:46:36 +0100 Subject: [PATCH] Popover: If can't get widget rect, zero output ptr cherry-pick of commit a6d40b610be6acb635d8732c11bb6d866bf2e95d Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/893#note_1766079 --- gtk/gtkpopover.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index 5093962aa1..2532472877 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -133,6 +133,8 @@ #include "gdk/gdksurfaceprivate.h" +#include /* memset */ + #define MNEMONICS_DELAY 300 /* ms */ #define TAIL_GAP_WIDTH 24 @@ -2192,7 +2194,10 @@ gtk_popover_get_pointing_to (GtkPopover *popover, GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (popover)); if (!gtk_widget_compute_bounds (parent, parent, &r)) - return FALSE; + { + memset (rect, 0, sizeof (GdkRectangle)); + return FALSE; + } rect->x = floorf (r.origin.x); rect->y = floorf (r.origin.y);