From: Po Lu Date: Sat, 11 Dec 2021 10:44:53 +0000 (+0800) Subject: Fix tooltips in PGTK child frames X-Git-Tag: emacs-29.0.90~3603 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8c29dbd3a81e6f0c9b9a76d4fd617f05ae2ea235;p=emacs.git Fix tooltips in PGTK child frames * src/gtkutil.c (xg_show_tooltip, xg_hide_tooltip): Make safe for child frames. --- diff --git a/src/gtkutil.c b/src/gtkutil.c index 225984af41a..0164d873bb3 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -928,15 +928,18 @@ xg_show_tooltip (struct frame *f, Lisp_Object string) { Lisp_Object encoded_string = ENCODE_UTF_8 (string); - gtk_widget_set_tooltip_text (FRAME_GTK_OUTER_WIDGET (f), SSDATA (encoded_string)); + gtk_widget_set_tooltip_text (FRAME_GTK_OUTER_WIDGET (f) + ? FRAME_GTK_OUTER_WIDGET (f) + : FRAME_GTK_WIDGET (f), + SSDATA (encoded_string)); } bool xg_hide_tooltip (struct frame *f) { - if (gtk_widget_get_tooltip_text (FRAME_GTK_OUTER_WIDGET (f)) == NULL) - return FALSE; - gtk_widget_set_tooltip_text (FRAME_GTK_OUTER_WIDGET (f), NULL); + if (FRAME_GTK_OUTER_WIDGET (f)) + gtk_widget_set_tooltip_text (FRAME_GTK_OUTER_WIDGET (f), NULL); + gtk_widget_set_tooltip_text (FRAME_GTK_WIDGET (f), NULL); return TRUE; }