emacs-diffs
[Top][All Lists]
Advanced

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

master e97580724d: Fix display corruption with background alpha set on u


From: Po Lu
Subject: master e97580724d: Fix display corruption with background alpha set on unsupported display
Date: Wed, 23 Feb 2022 00:14:39 -0500 (EST)

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

    Fix display corruption with background alpha set on unsupported display
    
    * src/xfns.c (x_set_alpha_background): Make opaque if display
    doesn't support the required features.
---
 src/xfns.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/xfns.c b/src/xfns.c
index 9afadd16e9..b2e3615fcf 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -737,6 +737,18 @@ x_set_alpha_background (struct frame *f, Lisp_Object arg, 
Lisp_Object oldval)
 
   gui_set_alpha_background (f, arg, oldval);
 
+#ifdef HAVE_XRENDER
+  /* Setting `alpha_background' to something other than opaque on a
+     display that doesn't support the required features leads to
+     confusing results.  */
+  if (f->alpha_background < 1.0
+      && !FRAME_DISPLAY_INFO (f)->alpha_bits
+      && !FRAME_CHECK_XR_VERSION (f, 0, 2))
+    f->alpha_background = 1.0;
+#else
+  f->alpha_background = 1.0;
+#endif
+
 #ifdef USE_GTK
   /* This prevents GTK from painting the window's background, which
      interferes with transparent background in some environments */



reply via email to

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