From: Po Lu Date: Mon, 31 Jan 2022 10:37:09 +0000 (+0800) Subject: Fix accesses to GTK structures on tooltip frames X-Git-Tag: emacs-29.0.90~2628 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=790ad61fcf91c75811ed30d21518e1dac99be044;p=emacs.git Fix accesses to GTK structures on tooltip frames * src/xfns.c (xic_set_preeditarea): Don't set the GTK context on tooltip frames. (x_set_alpha_background): Don't make tooltip frames paintable. * src/xterm.c (x_xr_ensure_picture): Get rid of GDK visual code. This is now done in a better way inside xg_create_frame_widgets. (bug#53654) --- diff --git a/src/xfns.c b/src/xfns.c index 656e68f0993..7007f70b191 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -735,8 +735,10 @@ x_set_alpha_background (struct frame *f, Lisp_Object arg, Lisp_Object oldval) #ifdef USE_GTK /* This prevents GTK from painting the window's background, which interferes with transparent background in some environments */ - gtk_widget_set_app_paintable (FRAME_GTK_OUTER_WIDGET (f), - f->alpha_background != 1.0); + + if (!FRAME_TOOLTIP_P (f)) + gtk_widget_set_app_paintable (FRAME_GTK_OUTER_WIDGET (f), + f->alpha_background != 1.0); #endif if (f->alpha_background != 1.0) @@ -2870,6 +2872,9 @@ xic_set_preeditarea (struct window *w, int x, int y) XFree (attr); } #ifdef USE_GTK + if (f->tooltip) + return; + GdkRectangle rect; int scale = xg_get_scale (f); diff --git a/src/xterm.c b/src/xterm.c index 12f3c0a9d17..5bcb77bbeba 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -384,18 +384,7 @@ x_xr_ensure_picture (struct frame *f) { XRenderPictureAttributes attrs; attrs.clip_mask = None; - XRenderPictFormat *fmt; - -#ifdef USE_GTK - GdkWindow *wnd = gtk_widget_get_window (FRAME_GTK_OUTER_WIDGET (f)); - GdkVisual *visual = gdk_window_get_visual (wnd); - Visual *xvisual = gdk_x11_visual_get_xvisual (visual); - - fmt = XRenderFindVisualFormat (FRAME_X_DISPLAY (f), xvisual); - - if (!fmt) -#endif - fmt = FRAME_X_PICTURE_FORMAT (f); + XRenderPictFormat *fmt = FRAME_X_PICTURE_FORMAT (f); FRAME_X_PICTURE (f) = XRenderCreatePicture (FRAME_X_DISPLAY (f), FRAME_X_RAW_DRAWABLE (f),