Bug 16154 - xprop -spy does not flush output
Summary: xprop -spy does not flush output
Alias: None
Product: xorg
Classification: Unclassified
Component: App/xprop (show other bugs)
Version: unspecified
Hardware: All All
: medium major
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
Keywords: janitor, patch
Depends on:
Reported: 2008-05-29 17:53 UTC by Kevin Pulo
Modified: 2018-06-17 19:36 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:

Patch to add flushing to xprop -spy (464 bytes, patch)
2008-05-29 17:53 UTC, Kevin Pulo
no flags Details | Splinter Review

Description Kevin Pulo 2008-05-29 17:53:35 UTC
Created attachment 16813 [details] [review]
Patch to add flushing to xprop -spy

When piping the output of xprop -spy into a script, the output is buffered, and so the script does not see property changes immediately.  This does not show up when xprop -spy is run from a tty, since then the output is unbuffered by default.

The fix is simple, just fflush(stdout) when entering spy mode and after outputting each property, a patch is attached.
Comment 1 Matthieu Herrb 2008-06-19 10:48:26 UTC
Normally, when output is a tty output is line-buffered, so it should only matter in the script case. 
Otherwise, that patch looks good to me. Any reason not to commit it?
Comment 2 Paulo César Pereira de Andrade 2008-11-27 22:30:36 UTC
Thanks for the patch.

This was corrected in commit

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.