]> git.eshelyaron.com Git - emacs.git/commitdiff
Work around some broken programs when reading opacity prop
authorPo Lu <luangruo@yahoo.com>
Tue, 10 May 2022 06:38:22 +0000 (14:38 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 10 May 2022 06:38:53 +0000 (14:38 +0800)
* src/xterm.c (handle_one_xevent): Accept some other types that
property is set to by thoughtless programs.

src/xterm.c

index de3129fd87c961eb47e353691abfea69b88b6e79..5818eb1d02e3ba08780419fb722dbd93d4fe1234 100644 (file)
@@ -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;