]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix accesses to GTK structures on tooltip frames
authorPo Lu <luangruo@yahoo.com>
Mon, 31 Jan 2022 10:37:09 +0000 (18:37 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 31 Jan 2022 10:38:24 +0000 (18:38 +0800)
* 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)

src/xfns.c
src/xterm.c

index 656e68f0993f55d22f889a2fbb630140b375d5c4..7007f70b1912c5dff6f36363647de76a508d20f5 100644 (file)
@@ -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);
 
index 12f3c0a9d17887673819c34f66d562a82011929b..5bcb77bbebac185df9c2becd04554254f6ef1ff8 100644 (file)
@@ -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),