emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 26a9acc86a: Fix some problems with inconsistent visuals on GDK


From: Po Lu
Subject: master 26a9acc86a: Fix some problems with inconsistent visuals on GDK
Date: Sun, 30 Jan 2022 01:04:24 -0500 (EST)

branch: master
commit 26a9acc86ae4e646b17570f009dcdf566f75c3de
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix some problems with inconsistent visuals on GDK
    
    * src/xterm.c (x_xr_ensure_picture): Use the visual GDK used
    instead of our own.
---
 src/xterm.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 209e99fc09..0ecebfb420 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -382,11 +382,22 @@ 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);
 
       FRAME_X_PICTURE (f) = XRenderCreatePicture (FRAME_X_DISPLAY (f),
                                                  FRAME_X_RAW_DRAWABLE (f),
-                                                 FRAME_X_PICTURE_FORMAT (f),
-                                                 CPClipMask, &attrs);
+                                                 fmt, CPClipMask, &attrs);
     }
 }
 #endif



reply via email to

[Prev in Thread] Current Thread [Next in Thread]