[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#538714: xprop: -spy doesn't flush STDOUT



Package: x11-utils
Version: 7.4+1
Severity: normal
Tags: patch

When using 'xprop -spy' in a script, output gets buffered and flushed after
many events filled the buffer. This behaviour makes this option useless for
scripting purposes.

Solution is simple and there is a patch available here:
http://archive.netbsd.se/?ml=xorg-team&a=2008-05&m=7510488

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages x11-utils depends on:
ii  cpp                    4:4.3.3-9         The GNU C preprocessor (cpp)
ii  libc6                  2.9-12            GNU C Library: Shared libraries
ii  libfontconfig1         2.6.0-4           generic font configuration library
ii  libfontenc1            1:1.0.4-3         X11 font encoding library
ii  libfreetype6           2.3.9-4.1         FreeType 2 font engine, shared lib
ii  libgl1-mesa-glx [libgl 7.0.3-7           A free implementation of the OpenG
ii  libice6                2:1.0.5-1         X11 Inter-Client Exchange library
ii  libsm6                 2:1.1.0-2         X11 Session Management library
ii  libx11-6               2:1.2.1-1         X11 client-side library
ii  libxaw7                2:1.0.5-2         X11 Athena Widget library
ii  libxext6               2:1.0.4-1         X11 miscellaneous extension librar
ii  libxft2                2.1.13-3          FreeType-based font drawing librar
ii  libxi6                 2:1.1.4-1         X11 Input extension library
ii  libxinerama1           2:1.0.3-2         X11 Xinerama extension library
ii  libxmu6                2:1.0.4-1         X11 miscellaneous utility library
ii  libxmuu1               2:1.0.4-1         X11 miscellaneous micro-utility li
ii  libxrender1            1:0.9.4-2         X Rendering Extension client libra
ii  libxt6                 1:1.0.5-3         X11 toolkit intrinsics library
ii  libxtst6               2:1.0.3-1         X11 Testing -- Resource extension 
ii  libxv1                 2:1.0.4-1         X11 Video extension library
ii  libxxf86dga1           2:1.0.2-1         X11 Direct Graphics Access extensi
ii  libxxf86vm1            1:1.0.2-1         X11 XFree86 video mode extension l
ii  x11-common             1:7.3+19          X Window System (X.Org) infrastruc
ii  zlib1g                 1:1.2.3.3.dfsg-13 compression library - runtime

x11-utils recommends no packages.

Versions of packages x11-utils suggests:
ii  mesa-utils                    7.0.3-7    Miscellaneous Mesa GL utilities

-- no debconf information
--- xprop.c.orig	2008-03-08 09:22:32.000000000 +1100
+++ xprop.c	2008-05-30 10:37:36.000000000 +1000
@@ -1738,6 +1738,7 @@
 	XEvent event;
 	const char *format, *dformat;
 	
+	fflush(stdout);
 	XSelectInput(dpy, target_win, PropertyChangeMask);
 	for (;;) {
 	    XNextEvent(dpy, &event);
@@ -1753,6 +1754,7 @@
 		dformat = props[i].dformat;
 	    }
 	    Show_Prop(format, dformat, Format_Atom(event.xproperty.atom));
+		fflush(stdout);
 	}
     }
     exit (0);

Reply to: