From 869956e95c111dc12f2411080c446c4f30869963 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sun, 20 Apr 2008 16:36:08 +0000 Subject: Update to xprop 1.0.4 --- app/xprop/ChangeLog | 320 ++++++++++++++++++++++++++++++++++++++++++++++--- app/xprop/Makefile.am | 22 +++- app/xprop/Makefile.in | 6 +- app/xprop/aclocal.m4 | 12 +- app/xprop/configure | 26 ++-- app/xprop/configure.ac | 3 +- app/xprop/dsimple.c | 309 +++++------------------------------------------ app/xprop/dsimple.h | 25 +--- app/xprop/xprop.c | 87 ++++++-------- 9 files changed, 418 insertions(+), 392 deletions(-) (limited to 'app') diff --git a/app/xprop/ChangeLog b/app/xprop/ChangeLog index a7722ec16..ad9d0bbaf 100644 --- a/app/xprop/ChangeLog +++ b/app/xprop/ChangeLog @@ -1,31 +1,313 @@ -2005-12-20 Kevin E. Martin +commit 427023df02bd38ff9dc2af2a2059466f37f4cfd8 +Author: Benjamin Close +Date: Wed Dec 19 15:17:34 2007 +1030 - * configure.ac: - Update package version for X11R7 release. + Fix build under autoconf 2.57 + + configure.ac specifies a max version of 2.57 but AC_CHECK_HEADERS_ONCE + was only introduced to autoconf in 2.59c. Drop the _ONCE to make autoconf happy + + Bug: 13631 + Found by: tinderbox + Approved by: daniels@ -2005-12-14 Kevin E. Martin +commit e09956f244099ddd36b1a2cd5d7800d5fc7120c1 +Author: Kim Woelders +Date: Thu Dec 6 05:30:43 2007 -0500 - * configure.ac: - Update package version number for final X11R7 release candidate. + Select correct client window in WM’s using virtual roots + From bug 2185¹ + + When manually selecting a window, xprop finds the top-level window containing + the pointer and uses XmuClientWindow to attempt to find a client window having + WM_STATE set. + + In a WM using virtual roots (e.g. enlightenment, desks other than first) this + fails beacuse the top-level window is a virtual root, and XmuClientWindow seems + to find the first client having WM_STATE set, which only by coincidence will be + the one the user intended to select (i.e. containing the pointer). + + The solution is to descend the window hierarchy at the pointer location to find + a window with WM_STATE set. + + 1] https://bugs.freedesktop.org/show_bug.cgi?id=2185 + + Signed-off-by: James Cloos -2005-12-06 Kevin E. Martin +commit 9ccda86dae06375750685977a81f4fb1cabf3d00 +Author: Alan Coopersmith +Date: Fri Aug 10 14:52:27 2007 -0700 - * Makefile.am: - Change *man_SOURCES ==> *man_PRE to fix autotools warnings. + Version bump: 1.0.3 -2005-12-03 Kevin E. Martin +commit 4f7bc8ecad63db6b7557b5556ac6f604e84eb55e +Author: Jay Hobson +Date: Wed Aug 8 13:38:33 2001 -0700 - * configure.ac: - Update package version number for X11R7 RC3 release. + Sun Bug 4474581: xprop fails in Japanese locale + + CJK locales need a much longer string as they include + many \xXX entries which expand into /XXXXXXXX entries. + Increased the buffer from 10000 to 500000 bytes. + Make sure buffer pointer doesn't go negative in _put_char. -2005-11-20 Alan Coopersmith +commit 23e375f3842b433b0af7f150135537f7381208ae +Author: Alan Coopersmith +Date: Fri Aug 10 14:17:51 2007 -0700 - * configure.ac: - Change dependency from xmu to xmuu since the full xmu - (with all its baggage like Xt) is not needed here. + Simplify printing of usage message -2005-10-18 Kevin E. Martin +commit fc788dc35532ebff44b5828f686b42e0deeec52c +Author: Alan Coopersmith +Date: Fri Aug 10 13:40:17 2007 -0700 - * configure.ac: - Update package version number for RC1 release. + Convert old #ifdefs for HAS_WTYPE_H & HAS_WCHAR_H to autoconf checks +commit b9860eeb000018a83233cec14ff0db8687a146b5 +Author: Alan Coopersmith +Date: Fri Aug 10 13:33:17 2007 -0700 + + Replace sprintf's with snprintf's + +commit 64326bae4e9b9c05b8781403ee27af95065eb2fb +Author: Alan Coopersmith +Date: Fri Aug 10 12:08:57 2007 -0700 + + Coverity #905: Handle_Prop_Requests returned without freeing storage "thunks" + +commit 866ceb3a671a9ab93b3ecbdf3231902ab2251ce3 +Author: Alan Coopersmith +Date: Fri Aug 10 11:56:41 2007 -0700 + + ANSIfy function declarations in dsimple.c + +commit 5424a5c064d96b33a4acdf951734cd3a493a7ea3 +Author: Alan Coopersmith +Date: Fri Aug 10 11:52:39 2007 -0700 + + Purge unused code from dsimple.c + + dsimple.c was originally shared source among several X apps. + Since modularization gave each app it's own copy, much of the code is + no longer needed in each app. + +commit 2d7dc57ae1d5e0af6e6ecb70764c512f6d518d6a +Author: Alan Coopersmith +Date: Fri Aug 10 11:43:04 2007 -0700 + + Add hooks to check sources with lint/sparse/etc. + +commit 7b3c0c95b9bb223ae779b8bf0c7d78967e0dcd9e +Author: Alan Coopersmith +Date: Fri Aug 10 11:35:27 2007 -0700 + + Change xprop_CFLAGS to AM_CFLAGS to clear automake-1.10 warning + + Makefile.am:27: compiling `dsimple.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.ac' + +commit c843fa3f4e65f2e1e133633b445f8693b1cc617c +Author: Alan Coopersmith +Date: Fri Aug 10 11:34:23 2007 -0700 + + Replace static ChangeLog with dist-hook to generate from git log + +commit 20955b2e662bb659533287d86fcd4d1cf75d3551 +Author: Alan Coopersmith +Date: Thu May 24 11:15:36 2007 -0700 + + renamed: .cvsignore -> .gitignore + +commit 91ca94a1d9e7eed7449c4243d84433180fc04566 +Author: Alan Coopersmith +Date: Thu May 24 11:12:17 2007 -0700 + + X.Org bug #10616: Add all the X info commands to See Also + + X.Org Bugzilla #10616: + Reported upstream from + Debian bug #350313 + +commit 4e8c0ec7c0b6b6602ae402313d8314f7653046ba +Author: Daniel Stone +Date: Tue Aug 29 20:03:33 2006 +0300 + + bump to 1.0.2 + +commit b8e4793e6bc939ee7b558f7eba7e4a485ed3bc7f +Author: Daniel Stone +Date: Thu Jul 27 09:11:10 2006 +0300 + + remove misleading comment + +commit 47514347db811d002e7f3ca05d390565bc3ee5e5 +Author: Branden Robinson +Date: Thu Jul 27 06:14:54 2006 +0300 + + handle actual_format_return == 0 (#7647) + Handle buggy servers which set actual_format_return == 0, instead of aborting. + +commit 56afcb5553455db8486bfb0e65e74506fc681940 +Author: Kevin E Martin +Date: Wed Dec 21 02:29:53 2005 +0000 + + Update package version for X11R7 release. + +commit 851cad34f8905d5111c7b5e30222efba8d630499 +Author: Adam Jackson +Date: Mon Dec 19 16:22:46 2005 +0000 + + Stub COPYING files + +commit 587c42a9bf142d16ddb349ab0afada5cbffc42c7 +Author: Kevin E Martin +Date: Thu Dec 15 00:24:10 2005 +0000 + + Update package version number for final X11R7 release candidate. + +commit 299da02da003a5804e58cf5e613aa1aa3321b3cb +Author: Kevin E Martin +Date: Tue Dec 6 22:48:25 2005 +0000 + + Change *man_SOURCES ==> *man_PRE to fix autotools warnings. + +commit 04bfd06dfa055d0143e2a98da1b06f84f02dca6d +Author: Kevin E Martin +Date: Sat Dec 3 05:49:27 2005 +0000 + + Update package version number for X11R7 RC3 release. + +commit 47e6c291ac25c8d83e7c70bc6bc4424d96cc8005 +Author: Alan Coopersmith +Date: Mon Nov 28 22:01:46 2005 +0000 + + Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4 + update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir) + +commit 3ab40d98cb38bd4f86bf93324af33fc995f9d3fd +Author: Eric Anholt +Date: Mon Nov 21 10:35:07 2005 +0000 + + Another pass at .cvsignores for apps. + +commit 454179bc4b51b24975e283c6ba1cd53d68d5e991 +Author: Alan Coopersmith +Date: Mon Nov 21 03:14:16 2005 +0000 + + Change dependency from xmu to xmuu since the full xmu (with all its baggage + like Xt) is not needed here. + +commit 62ca400ec36c59d941f85ce998cd8b694e121d26 +Author: Eric Anholt +Date: Sun Nov 20 22:08:55 2005 +0000 + + Add/improve .cvsignore files for apps. + +commit 7c240b0e4c3499046f2ba48b3aeefac358a0ded8 +Author: Kevin E Martin +Date: Wed Oct 19 02:47:57 2005 +0000 + + Update package version number for RC1 release. + +commit a7863c7b5d50c2f1e771501b300855b754799b7b +Author: Alan Coopersmith +Date: Mon Oct 17 23:56:24 2005 +0000 + + Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to + work better with BSD make + +commit 80aee62a58d653e62726f3cffd632bf91bc170a8 +Author: Alan Coopersmith +Date: Fri Oct 14 00:25:47 2005 +0000 + + Use sed to fill in variables in man page + +commit 3be3e6aaca45e0084eeb2634508d6644b1d5ce91 +Author: Alan Coopersmith +Date: Mon Aug 1 20:25:32 2005 +0000 + + Install man pages to section 1 instead of section m (Patch from Donnie + Berkholz) + +commit 54f2394a17da3a991d20d35e072e7fb2ec8df81c +Author: Kevin E Martin +Date: Fri Jul 29 21:22:37 2005 +0000 + + Various changes preparing packages for RC0: + - Verify and update package version numbers as needed + - Implement versioning scheme + - Change bug address to point to bugzilla bug entry form + - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to + reenable it) + - Fix makedepend to use pkgconfig and pass distcheck + - Update build script to build macros first + - Update modular Xorg version + +commit 4f970b38bdd2199adcd3510a84db12bcbf94c685 +Author: Adam Jackson +Date: Wed Jul 20 19:32:03 2005 +0000 + + Use a unique token for PKG_CHECK_MODULES. Otherwise, if you use a global + configure cache, you cache it, and the cached value is probably wrong. + +commit 721114f44cbd225a8fcd3655d4ded2dc8cc8837f +Author: Søren Sandmann Pedersen +Date: Fri Jul 8 20:58:05 2005 +0000 + + Add build system for xprop + +commit aa117205949e38efa5befcef3b206a8ea582109f +Author: Roland Mainz +Date: Wed Oct 6 19:29:59 2004 +0000 + + Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=1518 - Add filter + support to "xlsfonts" that it can filter builtin-, glyph- and/or other + kinds of printer fonts (controlled by the xp-listfonts-modes attribute + as described in the CDE DtPrint and Xprint specifications). + +commit d079bb69ea920d386a856d8cdd6b89a0f5632b16 +Author: Egbert Eich +Date: Fri Apr 23 19:55:03 2004 +0000 + + Merging XORG-CURRENT into trunk + +commit f5a1731210c83736e2b9f9a044e2f94947177229 +Author: Egbert Eich +Date: Sun Mar 14 08:35:42 2004 +0000 + + Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 + +commit 50acd849cb081dd9c458f1429a3b8108a26af050 +Author: Egbert Eich +Date: Wed Mar 3 12:13:15 2004 +0000 + + Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 + +commit f708da3feea11c5b859dc7652c8875f67065692e +Author: Egbert Eich +Date: Thu Feb 26 13:36:26 2004 +0000 + + readding XFree86's cvs IDs + +commit 49eb94d8560ca7609cc9c44f24a9a875ea3a1aca +Author: Egbert Eich +Date: Thu Feb 26 09:24:14 2004 +0000 + + Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004 + +commit 077b108056e58dbc7a46b447c4b4c05de9f30d85 +Author: Kaleb Keithley +Date: Tue Nov 25 19:29:15 2003 +0000 + + XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks + +commit 28c8159745754e1bd577797c2ef0d0bebded8299 +Author: Kaleb Keithley +Date: Fri Nov 14 16:49:23 2003 +0000 + + XFree86 4.3.0.1 + +commit 4cc997bd2d02961b95bff992f6dbfa30138879a9 +Author: Kaleb Keithley +Date: Fri Nov 14 15:54:54 2003 +0000 + + R6.6 is the Xorg base-line diff --git a/app/xprop/Makefile.am b/app/xprop/Makefile.am index 03e70c68e..d3fc24a16 100644 --- a/app/xprop/Makefile.am +++ b/app/xprop/Makefile.am @@ -21,12 +21,14 @@ bin_PROGRAMS = xprop -xprop_CFLAGS = $(XPROP_CFLAGS) +AM_CFLAGS = $(XPROP_CFLAGS) xprop_LDADD = $(XPROP_LIBS) xprop_SOURCES = \ dsimple.c \ dsimple.h \ + clientwin.c \ + clientwin.h \ xprop.c appman_PRE = \ @@ -37,8 +39,16 @@ appmandir = $(APP_MAN_DIR) appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) -EXTRA_DIST = $(appman_PRE) +EXTRA_DIST = $(appman_PRE) ChangeLog autogen.sh CLEANFILES = $(appman_DATA) +MAINTAINERCLEANFILES = ChangeLog + +.PHONY: ChangeLog + +ChangeLog: + (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2) + +dist-hook: ChangeLog SED = sed @@ -63,3 +73,11 @@ SUFFIXES = .$(APP_MAN_SUFFIX) .man .man.$(APP_MAN_SUFFIX): sed $(MAN_SUBSTS) < $< > $@ + +if LINT +ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) + +lint: + $(LINT) $(ALL_LINT_FLAGS) $(xprop_SOURCES) +endif LINT diff --git a/app/xprop/Makefile.in b/app/xprop/Makefile.in index 4e01ec9d4..50a83c90e 100644 --- a/app/xprop/Makefile.in +++ b/app/xprop/Makefile.in @@ -76,7 +76,8 @@ CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) -am_xprop_OBJECTS = dsimple.$(OBJEXT) xprop.$(OBJEXT) +am_xprop_OBJECTS = dsimple.$(OBJEXT) clientwin.$(OBJEXT) \ + xprop.$(OBJEXT) xprop_OBJECTS = $(am_xprop_OBJECTS) am__DEPENDENCIES_1 = xprop_DEPENDENCIES = $(am__DEPENDENCIES_1) @@ -217,6 +218,8 @@ xprop_LDADD = $(XPROP_LIBS) xprop_SOURCES = \ dsimple.c \ dsimple.h \ + clientwin.c \ + clientwin.h \ xprop.c appman_PRE = \ @@ -337,6 +340,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clientwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsimple.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprop.Po@am__quote@ diff --git a/app/xprop/aclocal.m4 b/app/xprop/aclocal.m4 index 5419cfb3c..48f9f8de2 100644 --- a/app/xprop/aclocal.m4 +++ b/app/xprop/aclocal.m4 @@ -1042,7 +1042,7 @@ AC_DEFUN([XORG_MACROS_VERSION],[ XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'` XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}]) - [XORG_MACROS_version=1.1.5 + [XORG_MACROS_version=1.1.6 XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'` XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then @@ -1191,7 +1191,11 @@ AC_DEFUN([XORG_CHECK_LINUXDOC],[ XORG_SGML_PATH=$prefix/share/sgml HAVE_DEFS_ENT= -AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) +if test x"$cross_compiling" = x"yes" ; then + HAVE_DEFS_ENT=no +else + AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) +fi AC_PATH_PROG(LINUXDOC, linuxdoc) AC_PATH_PROG(PS2PDF, ps2pdf) @@ -1463,14 +1467,14 @@ AC_DEFUN([XORG_RELEASE_VERSION],[ AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], [`echo $PACKAGE_VERSION | cut -d . -f 1`], [Major version of this package]) - PVM=`echo $PACKAGE_VERSION | cut -d . -f 2` + PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], [$PVM], [Minor version of this package]) - PVP=`echo $PACKAGE_VERSION | cut -d . -f 3` + PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi diff --git a/app/xprop/configure b/app/xprop/configure index 49a345213..602cc2149 100644 --- a/app/xprop/configure +++ b/app/xprop/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for xprop 1.0.3. +# Generated by GNU Autoconf 2.59 for xprop 1.0.4. # # Report bugs to . # @@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='xprop' PACKAGE_TARNAME='xprop' -PACKAGE_VERSION='1.0.3' -PACKAGE_STRING='xprop 1.0.3' +PACKAGE_VERSION='1.0.4' +PACKAGE_STRING='xprop 1.0.4' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' # Factoring default headers for most tests. @@ -791,7 +791,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xprop 1.0.3 to adapt to many kinds of systems. +\`configure' configures xprop 1.0.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -857,7 +857,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xprop 1.0.3:";; + short | recursive ) echo "Configuration of xprop 1.0.4:";; esac cat <<\_ACEOF @@ -989,7 +989,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -xprop configure 1.0.3 +xprop configure 1.0.4 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -1003,7 +1003,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xprop $as_me 1.0.3, which was +It was created by xprop $as_me 1.0.4, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1601,7 +1601,7 @@ fi # Define the identity of the package. PACKAGE='xprop' - VERSION='1.0.3' + VERSION='1.0.4' cat >>confdefs.h <<_ACEOF @@ -1767,7 +1767,7 @@ fi XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'` echo "$as_me:$LINENO: checking if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}" >&5 echo $ECHO_N "checking if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}... $ECHO_C" >&6 - XORG_MACROS_version=1.1.5 + XORG_MACROS_version=1.1.6 XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'` XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'` if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then @@ -4016,7 +4016,7 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1` _ACEOF - PVM=`echo $PACKAGE_VERSION | cut -d . -f 2` + PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi @@ -4025,7 +4025,7 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MINOR $PVM _ACEOF - PVP=`echo $PACKAGE_VERSION | cut -d . -f 3` + PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi @@ -4427,7 +4427,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by xprop $as_me 1.0.3, which was +This file was extended by xprop $as_me 1.0.4, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4490,7 +4490,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -xprop config.status 1.0.3 +xprop config.status 1.0.4 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" diff --git a/app/xprop/configure.ac b/app/xprop/configure.ac index 73052e7ad..e5288096b 100644 --- a/app/xprop/configure.ac +++ b/app/xprop/configure.ac @@ -1,4 +1,3 @@ - dnl Copyright 2005 Red Hat, Inc. dnl dnl Permission to use, copy, modify, distribute, and sell this software and its @@ -22,7 +21,7 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ([2.57]) -AC_INIT(xprop,[1.0.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xprop) +AC_INIT(xprop,[1.0.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xprop) AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE diff --git a/app/xprop/dsimple.c b/app/xprop/dsimple.c index c84ac3b51..2642e3164 100644 --- a/app/xprop/dsimple.c +++ b/app/xprop/dsimple.c @@ -41,9 +41,7 @@ from The Open Group. * Written by Mark Lillibridge. Last updated 7/1/87 */ -#ifdef BUILD_PRINTSUPPORT -#include -#endif /* BUILD_PRINTSUPPORT */ +#include "clientwin.h" #include "dsimple.h" /* @@ -61,18 +59,11 @@ from The Open Group. char *program_name = "unknown_program"; Display *dpy = NULL; int screen = 0; -Bool printer_output = False; /* Video or printer output ? */ -#ifdef BUILD_PRINTSUPPORT -XPContext pcontext = None; -#endif /* BUILD_PRINTSUPPORT */ - -static void _bitmap_error(int, char *); /* * Malloc: like malloc but handles out of memory using Fatal_Error. */ -char *Malloc(size) - unsigned size; +char *Malloc(unsigned size) { char *data; @@ -83,32 +74,13 @@ char *Malloc(size) } -/* - * Realloc: like Malloc except for realloc, handles NULL using Malloc. - */ -char *Realloc(ptr, size) - char *ptr; - int size; -{ - char *new_ptr; - - if (!ptr) - return(Malloc(size)); - - if (!(new_ptr = realloc(ptr, size))) - Fatal_Error("Out of memory!"); - - return(new_ptr); -} - - /* * Get_Display_Name (argc, argv) Look for -display, -d, or host:dpy (obselete) * If found, remove it from command line. Don't go past a lone -. */ -char *Get_Display_Name(pargc, argv) - int *pargc; /* MODIFIED */ - char **argv; /* MODIFIED */ +char *Get_Display_Name( + int *pargc, /* MODIFIED */ + char **argv) /* MODIFIED */ { int argc = *pargc; char **pargv = argv+1; @@ -138,49 +110,12 @@ char *Get_Display_Name(pargc, argv) } -#ifdef BUILD_PRINTSUPPORT -/* - * Get_Printer_Name (argc, argv) Look for -printer, -p, - * If found, remove it from command line. Don't go past a lone -. - */ -char *Get_Printer_Name(pargc, argv) - int *pargc; /* MODIFIED */ - char **argv; /* MODIFIED */ -{ - int argc = *pargc; - char **pargv = argv+1; - char *printername = NULL; - int i; - - for (i = 1; i < argc; i++) { - char *arg = argv[i]; - - if (!strcmp (arg, "-printer") || !strcmp (arg, "-p")) { - if (++i >= argc) usage (); - - printername = argv[i]; - *pargc -= 2; - continue; - } - if (!strcmp(arg,"-")) { - while (i #include @@ -37,24 +38,23 @@ from The Open Group. #include #include #include -#ifdef HAS_WCHAR_H +#ifdef HAVE_WCHAR_H #include #endif -#ifdef HAS_WCTYPE_H +#ifdef HAVE_WCTYPE_H #include #endif #include -#ifndef HAS_WCTYPE_H +#ifndef HAVE_WCTYPE_H #define iswprint(x) isprint(x) #endif #include -#include #include "dsimple.h" -#define MAXSTR 10000 +#define MAXSTR 500000 #define MAXELEMENTS 64 #ifndef min @@ -583,21 +583,21 @@ static char _formatting_buffer2[21]; static const char * Format_Hex (long wrd) { - sprintf(_formatting_buffer2, "0x%lx", wrd); + snprintf(_formatting_buffer2, sizeof(_formatting_buffer2), "0x%lx", wrd); return _formatting_buffer2; } static const char * Format_Unsigned (long wrd) { - sprintf(_formatting_buffer2, "%lu", wrd); + snprintf(_formatting_buffer2, sizeof(_formatting_buffer2), "%lu", wrd); return _formatting_buffer2; } static const char * Format_Signed (long wrd) { - sprintf(_formatting_buffer2, "%ld", wrd); + snprintf(_formatting_buffer2, sizeof(_formatting_buffer2), "%ld", wrd); return _formatting_buffer2; } @@ -622,7 +622,8 @@ Format_Atom (Atom atom) name = XGetAtomName(dpy, atom); XSetErrorHandler(handler); if (! name) - sprintf(_formatting_buffer, "undefined atom # 0x%lx", atom); + snprintf(_formatting_buffer, sizeof(_formatting_buffer), + "undefined atom # 0x%lx", atom); else { int namelen = strlen(name); if (namelen > MAXSTR) namelen = MAXSTR; @@ -669,11 +670,12 @@ static int _buf_len; static void _put_char (char c) { - if (--_buf_len < 0) { + if (_buf_len <= 0) { _buf_ptr[0] = '\0'; return; } _buf_ptr++[0] = c; + _buf_len--; } static void @@ -696,7 +698,7 @@ _format_char (char c) default: if (!c_isprint(c)) { _put_char('\\'); - sprintf(_buf_ptr, "%03o", (unsigned char) c); + snprintf(_buf_ptr, _buf_len, "%03o", (unsigned char) c); _buf_ptr += 3; _buf_len -= 3; } else @@ -770,7 +772,7 @@ Format_Len_Text (const char *string, int len, Atom encoding) len -= n; } else { _put_char('\\'); - sprintf(_buf_ptr, "%03o", (unsigned char) *string); + snprintf(_buf_ptr, _buf_len, "%03o", (unsigned char) *string); _buf_ptr += 3; _buf_len -= 3; string++; @@ -779,7 +781,7 @@ Format_Len_Text (const char *string, int len, Atom encoding) } count--; if (count > 0) { - sprintf(_buf_ptr, "\\000"); + snprintf(_buf_ptr, _buf_len, "\\000"); _buf_ptr += 4; _buf_len -= 4; } @@ -1287,14 +1289,14 @@ Handle_Prop_Requests (int argc, char **argv) char *format, *dformat, *prop; thunk *thunks, t; - thunks = Create_Thunk_List(); - /* if no prop referenced, by default list all properties for given window */ if (!argc) { Show_All_Props(); return NULL; } + thunks = Create_Thunk_List(); + while (argc > 0) { format = NULL; dformat = NULL; @@ -1513,33 +1515,29 @@ Set_Property (Display *dpy, Window w, const char *propname, const char *value) void usage (void) { - char **cpp; - static char *help_message[] = { -"where options include:", -" -grammar print out full grammar for command line", -" -display host:dpy the X server to contact", -" -id id resource id of window to examine", -" -name name name of window to examine", -" -font name name of font to examine", -" -remove propname remove a property", -" -set propname value set a property to a given value", -" -root examine the root window", -" -len n display at most n bytes of any property", -" -notype do not display the type field", -" -fs filename where to look for formats for properties", -" -frame don't ignore window manager frames", -" -f propname format [dformat] formats to use for property of given name", -" -spy examine window properties forever", -NULL}; + static const char help_message[] = +"where options include:\n" +" -grammar print out full grammar for command line\n" +" -display host:dpy the X server to contact\n" +" -id id resource id of window to examine\n" +" -name name name of window to examine\n" +" -font name name of font to examine\n" +" -remove propname remove a property\n" +" -set propname value set a property to a given value\n" +" -root examine the root window\n" +" -len n display at most n bytes of any property\n" +" -notype do not display the type field\n" +" -fs filename where to look for formats for properties\n" +" -frame don't ignore window manager frames\n" +" -f propname format [dformat] formats to use for property of given name\n" +" -spy examine window properties forever\n"; + fflush (stdout); fprintf (stderr, "usage: %s [-options ...] [[format [dformat]] atom] ...\n\n", program_name); - for (cpp = help_message; *cpp; cpp++) { - fprintf (stderr, "%s\n", *cpp); - } - fprintf (stderr, "\n"); + fprintf (stderr, "%s\n", help_message); exit (1); } @@ -1703,19 +1701,8 @@ main (int argc, char **argv) if ((remove_props != NULL || set_props != NULL) && argc > 0) usage(); - if (target_win == None) { - target_win = Select_Window(dpy); - if (target_win != None && !frame_only) { - Window root; - int dummyi; - unsigned int dummy; - - if (XGetGeometry (dpy, target_win, &root, &dummyi, &dummyi, - &dummy, &dummy, &dummy, &dummy) - && target_win != root) - target_win = XmuClientWindow (dpy, target_win); - } - } + if (target_win == None) + target_win = Select_Window(dpy, !frame_only); if (remove_props != NULL) { int count; -- cgit v1.2.3