From: Po Lu Date: Tue, 10 May 2022 06:38:22 +0000 (+0800) Subject: Work around some broken programs when reading opacity prop X-Git-Tag: emacs-29.0.90~1910^2~852 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=58f6cbeb58c2394f6360e97d1a6e49c1c1df3166;p=emacs.git 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. --- diff --git a/src/xterm.c b/src/xterm.c index de3129fd87c..5818eb1d02e 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;