Bug#832954: xwd does not interact well with i3
Package: x11-apps
Severity: minor
Version: 7.7+6
Tags: patch
Hi,
xwd cannot cope with the way i3 sets up the window hierarchy. Attempting
a root window grab results in:
=====
jcn@inti:/tmp$ xwd -root > /dev/null
X Error of failed request: BadColor (invalid Colormap parameter)
Major opcode of failed request: 91 (X_QueryColors)
Resource id in failed request: 0x0
Serial number of failed request: 166
Current serial number in output stream: 166
=====
... due to, somewhere along the tree:
=====
jcn@inti:/tmp$ xwininfo -id 0x80085e
xwininfo: Window id: 0x80085e "[i3 con] workspace 9"
Absolute upper-left X: 0
Absolute upper-left Y: 0
Relative upper-left X: 0
Relative upper-left Y: 0
Width: 1600
Height: 18
Depth: 32
Visual: 0x7c
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x0 (not installed)
[...]
=====
Specifying '-icmap' does not help as the failing call to XQueryColors()
is not the one in xwd/xwd.c, but the one in xwd/multiVis.c (which is not
affected by '-icmap').
A proper fix would probably be to make the "use_installed" boolean non-static
and copy the full logic from xwd.c:596 to multiVis.c:236 (or preferably to
line 302, where the image_region_type and thus also the WindowID is still
available).
My quick-and-dirty patch at least fixes the symptom, but is only half the
story.
Thanks for considering,
Jan
--
Jan Nordholz <jnordholz@sec.t-labs.tu-berlin.de>
Security in Telecommunications <fgsect.de>
TU Berlin / Telekom Innovation Laboratories
Ernst-Reuter-Platz 7, Sekr TEL 17 / D - 10587 Berlin, Germany
phone: +49 30 8353 58663
--- a/xwd/multiVis.c 2013-08-09 06:12:24.000000000 +0200
+++ b/xwd/multiVis.c 2016-07-30 02:58:54.879020723 +0200
@@ -299,6 +299,10 @@
XColor *colors;
int rShift = 0, gShift = 0, bShift = 0;
+ if (reg->cmap == 0) {
+ reg->cmap = XListInstalledColormaps(disp, reg->win, &i)[0];
+ }
+
QueryColorMap(disp,reg->cmap,reg->vis,&colors,
&rShift,&gShift,&bShift) ;
Reply to: