emacs-diffs
[Top][All Lists]
Advanced

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

master 58f6cbeb58: Work around some broken programs when reading opacity


From: Po Lu
Subject: master 58f6cbeb58: Work around some broken programs when reading opacity prop
Date: Tue, 10 May 2022 02:39:05 -0400 (EDT)

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

    Work around some broken programs when reading opacity prop
    
    * src/xterm.c (handle_one_xevent): Accept some other types that
    property is set to by thoughtless programs.
---
 src/xterm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index de3129fd87..5818eb1d02 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -14861,11 +14861,16 @@ handle_one_xevent (struct x_display_info *dpyinfo,
            {
              rc = XGetWindowProperty (dpyinfo->display, FRAME_OUTER_WINDOW (f),
                                       dpyinfo->Xatom_net_wm_window_opacity,
-                                      0, 1, False, XA_CARDINAL, &actual,
+                                      0, 1, False, AnyPropertyType, &actual,
                                       &actual_format, &n, &left, &tmp_data);
 
              if (rc == Success && actual_format == 32
-                 && actual == XA_CARDINAL && n)
+                 && (actual == XA_CARDINAL
+                     /* Some broken programs set the opacity property
+                        to those types, but window managers accept
+                        them anyway.  */
+                     || actual == XA_ATOM
+                     || actual == XA_WINDOW) && n)
                {
                  opacity = *(unsigned long *) tmp_data & OPAQUE;
                  f->alpha[0] = (double) opacity / (double) OPAQUE;



reply via email to

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