Description of problem: This is a new bug in xwininfo, created when this utility was translated from Xlib to XCB. "xwininfo -name ..." is supposed to find a window with the given name, but it can also find any window with an empty name. The bug is in dsimple.c. All three calls to strncmp in that file should *not* use strlen(prop_name), but rather strlen(name). Otherwise, when any random window has an empty name, 0 characters are compared between this empty string and the looked-up name, and of course a match is found :-) I also sent this bug upstream: https://bugs.freedesktop.org/show_bug.cgi?id=37710. Version-Release number of selected component (if applicable): Tested on xorg-x11-utils-7.5-2.fc15.x86_64 How reproducible: Steps to Reproduce: 1. run Firefox # this creates a window with an empty name) 2. xwininfo -name XYZ # there isn't supposed to be a window with this name Actual results: xwininfo: Window id: 0x2a0006d (has no name) Absolute upper-left X: 0 Absolute upper-left Y: 0 Relative upper-left X: 0 Relative upper-left Y: 0 Width: 200 Height: 200 ... Expected results: xwininfo: error: No window with name "XYZ" exists! Additional info:
Correction - switching to strlen(name) isn't accurate either. I proposed a more accurate fix on the upstream bugzilla (see link above).
I believe that it is more appropriate to let this bug be resolved upstream. We will continue to track the issue in the centralized upstream bug tracker, and will review any bug fixes that become available for consideration in future updates. Thank you for helping to make free software better.