From a99339125b2512e565c0e3eea6a28275aa7765c1 Mon Sep 17 00:00:00 2001 From: matthieu Date: Sun, 20 Apr 2008 16:36:07 +0000 Subject: [PATCH] Update to xprop 1.0.4 --- app/xprop/ChangeLog | 36 ++++++++++++++++++++++++++++++++++++ app/xprop/Makefile.am | 2 ++ app/xprop/Makefile.in | 6 +++++- app/xprop/aclocal.m4 | 12 ++++++++---- app/xprop/configure | 26 +++++++++++++------------- app/xprop/configure.ac | 3 +-- app/xprop/dsimple.c | 8 +++++++- app/xprop/dsimple.h | 2 +- app/xprop/xprop.c | 16 ++-------------- 9 files changed, 75 insertions(+), 36 deletions(-) diff --git a/app/xprop/ChangeLog b/app/xprop/ChangeLog index 6c2b0224c..ad9d0bbaf 100644 --- a/app/xprop/ChangeLog +++ b/app/xprop/ChangeLog @@ -1,3 +1,39 @@ +commit 427023df02bd38ff9dc2af2a2059466f37f4cfd8 +Author: Benjamin Close +Date: Wed Dec 19 15:17:34 2007 +1030 + + 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@ + +commit e09956f244099ddd36b1a2cd5d7800d5fc7120c1 +Author: Kim Woelders +Date: Thu Dec 6 05:30:43 2007 -0500 + + 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 + commit 9ccda86dae06375750685977a81f4fb1cabf3d00 Author: Alan Coopersmith Date: Fri Aug 10 14:52:27 2007 -0700 diff --git a/app/xprop/Makefile.am b/app/xprop/Makefile.am index e4fc5ad8e..d3fc24a16 100644 --- a/app/xprop/Makefile.am +++ b/app/xprop/Makefile.am @@ -27,6 +27,8 @@ xprop_LDADD = $(XPROP_LIBS) xprop_SOURCES = \ dsimple.c \ dsimple.h \ + clientwin.c \ + clientwin.h \ xprop.c appman_PRE = \ 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 0c9fce8b5..2642e3164 100644 --- a/app/xprop/dsimple.c +++ b/app/xprop/dsimple.c @@ -41,6 +41,7 @@ from The Open Group. * Written by Mark Lillibridge. Last updated 7/1/87 */ +#include "clientwin.h" #include "dsimple.h" /* @@ -263,7 +264,7 @@ Window Select_Window_Args( * Routine to let user select a window using the mouse */ -Window Select_Window(Display *dpy) +Window Select_Window(Display *dpy, int descend) { int status; Cursor cursor; @@ -302,6 +303,11 @@ Window Select_Window(Display *dpy) XUngrabPointer(dpy, CurrentTime); /* Done with pointer */ + if (!descend || (target_win == root)) + return(target_win); + + target_win = Find_Client(dpy, root, target_win); + return(target_win); } diff --git a/app/xprop/dsimple.h b/app/xprop/dsimple.h index 7b53c3c0b..755757162 100644 --- a/app/xprop/dsimple.h +++ b/app/xprop/dsimple.h @@ -78,7 +78,7 @@ void usage(void); * Send bugs, etc. to chariot@athena.mit.edu. */ -Window Select_Window(Display *); +Window Select_Window(Display *, int descend); Window Window_With_Name(Display *, Window, const char *); #ifdef __GNUC__ void Fatal_Error(char *, ...) __attribute__((__noreturn__)); diff --git a/app/xprop/xprop.c b/app/xprop/xprop.c index c48948602..f1bf02a41 100644 --- a/app/xprop/xprop.c +++ b/app/xprop/xprop.c @@ -51,7 +51,6 @@ from The Open Group. #endif #include -#include #include "dsimple.h" @@ -1702,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;