summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-01-31 18:37:09 +0800
committerPo Lu <luangruo@yahoo.com>2022-01-31 18:38:24 +0800
commit790ad61fcf91c75811ed30d21518e1dac99be044 (patch)
tree649319edc86fd451f799800df362a62881782ee4 /src
parent2ce7ac1c502b1a362648d0a946c84659adf035e0 (diff)
downloademacs-790ad61fcf91c75811ed30d21518e1dac99be044.tar.gz
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)
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c9
-rw-r--r--src/xterm.c13
2 files changed, 8 insertions, 14 deletions
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),