xwininfo 1.0.4
This commit is contained in:
parent
ef0d58967c
commit
b58642ac9d
@ -1,36 +1,52 @@
|
||||
commit b8115ee0e43c6c03025cad72219481e3fdb119d4
|
||||
Author: James Cloos <cloos@jhcloos.com>
|
||||
Date: Sun Jun 29 10:49:10 2008 -0400
|
||||
|
||||
xwininfo 1.0.4
|
||||
|
||||
commit c229611bcb7ee94bea5c075f5e15447e14c0f6ce
|
||||
Author: Kim Woelders <kim@woelders.dk>
|
||||
Date: Sun Jun 22 01:11:50 2008 -0400
|
||||
|
||||
Fix window selection by pointer.
|
||||
|
||||
This should fix things in WM’s using virtual roots as well as in tabbing WM’s.
|
||||
|
||||
Signed-off-by: James Cloos <cloos@jhcloos.com>
|
||||
|
||||
commit b7e88cd9d28a3d3e467b769f3efe87f7c2f4c0a5
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Mon Aug 27 14:20:35 2007 -0700
|
||||
Date: Mon Aug 27 14:20:12 2007 -0700
|
||||
|
||||
Version bump: 1.0.3
|
||||
|
||||
commit 56f0b5dfb1486e262eb514fac44c73cea4bb4471
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Mon Aug 27 14:20:02 2007 -0700
|
||||
Date: Mon Aug 27 14:19:39 2007 -0700
|
||||
|
||||
Replace static ChangeLog with dist-hook to generate from git log
|
||||
|
||||
commit c8d205c30547ca526404a0b257c3cc5d40970be6
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Tue Aug 7 15:50:13 2007 -0700
|
||||
Date: Tue Aug 7 15:49:50 2007 -0700
|
||||
|
||||
Add static & const qualifiers to xwininfo.c
|
||||
|
||||
commit 77d50c0bf824f847bd9ede30c21618845258de76
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Tue Aug 7 15:38:23 2007 -0700
|
||||
Date: Tue Aug 7 15:38:00 2007 -0700
|
||||
|
||||
Replace sprintf's with snprintf & strlcat
|
||||
|
||||
commit 118bd50a9bbc10cab7846fb6ac1a0d25ba4c3422
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Mon Aug 6 19:52:13 2007 -0700
|
||||
Date: Mon Aug 6 19:51:50 2007 -0700
|
||||
|
||||
dsimple.c: ANSIfy function declarations
|
||||
|
||||
commit e093e4be56bb2be385a972962cf89f234e987ab4
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Mon Aug 6 19:44:24 2007 -0700
|
||||
Date: Mon Aug 6 19:44:01 2007 -0700
|
||||
|
||||
Purge unused code from dsimple.c
|
||||
|
||||
@ -40,7 +56,7 @@ Date: Mon Aug 6 19:44:24 2007 -0700
|
||||
|
||||
commit 59bbe12a40fdb3d39429d0d0ce809ad28116e7ed
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Mon Aug 6 19:18:57 2007 -0700
|
||||
Date: Mon Aug 6 19:18:34 2007 -0700
|
||||
|
||||
Rename xwininfo_CFLAGS to AM_CFLAGS to make automake-1.10 happier
|
||||
|
||||
@ -48,19 +64,19 @@ Date: Mon Aug 6 19:18:57 2007 -0700
|
||||
|
||||
commit 5a251886c0f158f4c8a342b6fbdeebf3dbd1c0fd
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Thu May 24 18:20:11 2007 -0700
|
||||
Date: Thu May 24 18:19:48 2007 -0700
|
||||
|
||||
Man page formatting: make -geometry bold like other options
|
||||
|
||||
commit 07459b14b36f15cfdfc6384019aaf020c7920cd4
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Thu May 24 18:17:28 2007 -0700
|
||||
Date: Thu May 24 18:17:05 2007 -0700
|
||||
|
||||
renamed: .cvsignore -> .gitignore
|
||||
|
||||
commit 24fc2a569df9eaa776bcdddbb26bf4ea97b69d13
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Thu May 24 18:16:53 2007 -0700
|
||||
Date: Thu May 24 18:16:30 2007 -0700
|
||||
|
||||
X.Org bug #10616: Add all the X info commands to See Also in man page
|
||||
|
||||
@ -70,75 +86,75 @@ Date: Thu May 24 18:16:53 2007 -0700
|
||||
|
||||
commit 412a3232373131634072df0d0b4843abf360def4
|
||||
Author: Adam Jackson <ajax@nwnk.net>
|
||||
Date: Sun Apr 2 01:19:53 2006 +0000
|
||||
Date: Sun Apr 2 01:19:30 2006 +0000
|
||||
|
||||
Bump to 1.0.2.
|
||||
|
||||
commit 8d62050702532be39688d468663466199492510b
|
||||
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
|
||||
Date: Fri Mar 10 02:37:18 2006 +0000
|
||||
Date: Fri Mar 10 02:36:55 2006 +0000
|
||||
|
||||
Clear two tiny memory leaks. (Coverity ids #900 & 901)
|
||||
|
||||
commit 609828be5a05bc71fffaf8fc129a0cae8082fd57
|
||||
Author: Kevin E Martin <kem@kem.org>
|
||||
Date: Wed Dec 21 02:29:55 2005 +0000
|
||||
Date: Wed Dec 21 02:29:33 2005 +0000
|
||||
|
||||
Update package version for X11R7 release.
|
||||
|
||||
commit a4169ffa7eb6eb9a28fd64a0686a813da975736c
|
||||
Author: Adam Jackson <ajax@nwnk.net>
|
||||
Date: Mon Dec 19 16:22:48 2005 +0000
|
||||
Date: Mon Dec 19 16:22:26 2005 +0000
|
||||
|
||||
Stub COPYING files
|
||||
|
||||
commit b9403df95678e568a326fe3f37bf29285a6a211e
|
||||
Author: Kevin E Martin <kem@kem.org>
|
||||
Date: Thu Dec 15 00:24:12 2005 +0000
|
||||
Date: Thu Dec 15 00:23:50 2005 +0000
|
||||
|
||||
Update package version number for final X11R7 release candidate.
|
||||
|
||||
commit 6f9523999cc4eb34accfe0bcc2c7a74bae9259ef
|
||||
Author: Kevin E Martin <kem@kem.org>
|
||||
Date: Tue Dec 6 22:48:27 2005 +0000
|
||||
Date: Tue Dec 6 22:48:05 2005 +0000
|
||||
|
||||
Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
|
||||
|
||||
commit 28c0455ea50bdf37f1d9d53c6756beebed429f0e
|
||||
Author: Kevin E Martin <kem@kem.org>
|
||||
Date: Sat Dec 3 05:49:29 2005 +0000
|
||||
Date: Sat Dec 3 05:49:07 2005 +0000
|
||||
|
||||
Update package version number for X11R7 RC3 release.
|
||||
|
||||
commit 988471c67e10a5ca309b90146b37a6037f5b2efc
|
||||
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
|
||||
Date: Mon Nov 28 22:01:48 2005 +0000
|
||||
Date: Mon Nov 28 22:01:26 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 4496e95380b2f0ad7e9bdca02ec192dbb6d5e2e5
|
||||
Author: Eric Anholt <anholt@freebsd.org>
|
||||
Date: Mon Nov 21 10:35:09 2005 +0000
|
||||
Date: Mon Nov 21 10:34:47 2005 +0000
|
||||
|
||||
Another pass at .cvsignores for apps.
|
||||
|
||||
commit 296d8e6ab8a86e5653529d0497ca5751d89f23b5
|
||||
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
|
||||
Date: Mon Nov 21 03:14:17 2005 +0000
|
||||
Date: Mon Nov 21 03:13:55 2005 +0000
|
||||
|
||||
Change dependency from xmu to xmuu since the full xmu (with all its baggage
|
||||
like Xt) is not needed here.
|
||||
|
||||
commit 27898506332f1a4e698cbd65aecc47fdbc6d0a7b
|
||||
Author: Eric Anholt <anholt@freebsd.org>
|
||||
Date: Sun Nov 20 22:08:56 2005 +0000
|
||||
Date: Sun Nov 20 22:08:34 2005 +0000
|
||||
|
||||
Add/improve .cvsignore files for apps.
|
||||
|
||||
commit ee7bf4989434ba5f30451c3f07e4a6e01e6532d4
|
||||
Author: Kevin E Martin <kem@kem.org>
|
||||
Date: Sat Nov 19 07:15:38 2005 +0000
|
||||
Date: Sat Nov 19 07:15:16 2005 +0000
|
||||
|
||||
Update pkgconfig files to separate library build-time dependencies from
|
||||
application build-time dependencies, and update package deps to work
|
||||
@ -146,33 +162,33 @@ Date: Sat Nov 19 07:15:38 2005 +0000
|
||||
|
||||
commit 4e58b0e12d46503c5f75ead9a859694aafd5b9b7
|
||||
Author: Kevin E Martin <kem@kem.org>
|
||||
Date: Wed Oct 19 02:47:58 2005 +0000
|
||||
Date: Wed Oct 19 02:47:36 2005 +0000
|
||||
|
||||
Update package version number for RC1 release.
|
||||
|
||||
commit fc097904a8d7ded9a60df35fd58b9f5b5e226e17
|
||||
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
|
||||
Date: Mon Oct 17 23:56:25 2005 +0000
|
||||
Date: Mon Oct 17 23:56:03 2005 +0000
|
||||
|
||||
Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
|
||||
work better with BSD make
|
||||
|
||||
commit 22feb546d5bf499ec0bc726c60a6c46f2e2cbd1c
|
||||
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
|
||||
Date: Fri Oct 14 00:25:48 2005 +0000
|
||||
Date: Fri Oct 14 00:25:26 2005 +0000
|
||||
|
||||
Use sed to fill in variables in man page
|
||||
|
||||
commit 9b1a4cbaf609bb102adec047934ad4c1b05f01ab
|
||||
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
|
||||
Date: Mon Aug 1 20:25:33 2005 +0000
|
||||
Date: Mon Aug 1 20:25:11 2005 +0000
|
||||
|
||||
Install man pages to section 1 instead of section m (Patch from Donnie
|
||||
Berkholz)
|
||||
|
||||
commit 70ed22f5e63d5759a0b7c6574a92d124c0777562
|
||||
Author: Kevin E Martin <kem@kem.org>
|
||||
Date: Fri Jul 29 21:22:39 2005 +0000
|
||||
Date: Fri Jul 29 21:22:17 2005 +0000
|
||||
|
||||
Various changes preparing packages for RC0:
|
||||
- Verify and update package version numbers as needed
|
||||
@ -186,20 +202,20 @@ Date: Fri Jul 29 21:22:39 2005 +0000
|
||||
|
||||
commit 270145dc0f3ad5c7ad7d6086da19c0a25ea853a9
|
||||
Author: Adam Jackson <ajax@nwnk.net>
|
||||
Date: Wed Jul 20 19:32:05 2005 +0000
|
||||
Date: Wed Jul 20 19:31:43 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 97aa768841e147fde3cf16ba9a4c852358085d27
|
||||
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
|
||||
Date: Fri Jul 8 21:00:46 2005 +0000
|
||||
Date: Fri Jul 8 21:00:24 2005 +0000
|
||||
|
||||
Build system for xwininfo
|
||||
|
||||
commit 5cd08344c43c739c9a6837f1a60ae7c42e5afabe
|
||||
Author: Roland Mainz <roland.mainz@nrubsig.org>
|
||||
Date: Wed Oct 6 19:29:59 2004 +0000
|
||||
Date: Wed Oct 6 19:29:37 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
|
||||
@ -208,54 +224,54 @@ Date: Wed Oct 6 19:29:59 2004 +0000
|
||||
|
||||
commit ac7cc196b722ee4653326aee459f40ad16a260c1
|
||||
Author: Egbert Eich <eich@suse.de>
|
||||
Date: Fri Apr 23 19:55:09 2004 +0000
|
||||
Date: Fri Apr 23 19:54:47 2004 +0000
|
||||
|
||||
Merging XORG-CURRENT into trunk
|
||||
|
||||
commit 43e099d499d4dbabb32ca0410175e0e1b814cd94
|
||||
Author: Egbert Eich <eich@suse.de>
|
||||
Date: Sun Mar 14 08:35:54 2004 +0000
|
||||
Date: Sun Mar 14 08:35:32 2004 +0000
|
||||
|
||||
Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
|
||||
|
||||
commit cd710399eb415673c180f65080d685ee8d149361
|
||||
Author: Egbert Eich <eich@suse.de>
|
||||
Date: Wed Mar 3 12:13:20 2004 +0000
|
||||
Date: Wed Mar 3 12:12:58 2004 +0000
|
||||
|
||||
Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
|
||||
|
||||
commit 436a7ecb4b764394abcdd06fd99d6232c633cad1
|
||||
Author: Egbert Eich <eich@suse.de>
|
||||
Date: Thu Feb 26 13:36:32 2004 +0000
|
||||
Date: Thu Feb 26 13:36:10 2004 +0000
|
||||
|
||||
readding XFree86's cvs IDs
|
||||
|
||||
commit 6dfbd3f819f10e4d04653df2074526860007968e
|
||||
Author: Egbert Eich <eich@suse.de>
|
||||
Date: Thu Feb 26 09:24:18 2004 +0000
|
||||
Date: Thu Feb 26 09:23:56 2004 +0000
|
||||
|
||||
Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
|
||||
|
||||
commit a2fa980ce0e98c2bbc503d1d9fe51ab539b7ea46
|
||||
Author: Egbert Eich <eich@suse.de>
|
||||
Date: Thu Jan 29 08:09:21 2004 +0000
|
||||
Date: Thu Jan 29 08:08:59 2004 +0000
|
||||
|
||||
Importing vendor version xf86-012804-2330 on Thu Jan 29 00:06:33 PST 2004
|
||||
|
||||
commit 429530ba6f7699436d6f789a17550ec1a691c675
|
||||
Author: Kaleb Keithley <kaleb@freedesktop.org>
|
||||
Date: Tue Nov 25 19:29:23 2003 +0000
|
||||
Date: Tue Nov 25 19:29:01 2003 +0000
|
||||
|
||||
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
|
||||
|
||||
commit be0f398fee08e03ab73ec0d580df688cc989fbaa
|
||||
Author: Kaleb Keithley <kaleb@freedesktop.org>
|
||||
Date: Fri Nov 14 16:49:24 2003 +0000
|
||||
Date: Fri Nov 14 16:49:02 2003 +0000
|
||||
|
||||
XFree86 4.3.0.1
|
||||
|
||||
commit 5e5a590668dc3ebe7e2cb568aad4c9c14021f2a2
|
||||
Author: Kaleb Keithley <kaleb@freedesktop.org>
|
||||
Date: Fri Nov 14 15:54:55 2003 +0000
|
||||
Date: Fri Nov 14 15:54:33 2003 +0000
|
||||
|
||||
R6.6 is the Xorg base-line
|
||||
|
@ -25,6 +25,8 @@ AM_CFLAGS = $(XWININFO_CFLAGS)
|
||||
xwininfo_LDADD = $(XWININFO_LIBS)
|
||||
|
||||
xwininfo_SOURCES = \
|
||||
clientwin.c \
|
||||
clientwin.h \
|
||||
dsimple.c \
|
||||
dsimple.h \
|
||||
xwininfo.c
|
||||
|
@ -76,7 +76,8 @@ CONFIG_CLEAN_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_xwininfo_OBJECTS = dsimple.$(OBJEXT) xwininfo.$(OBJEXT)
|
||||
am_xwininfo_OBJECTS = clientwin.$(OBJEXT) dsimple.$(OBJEXT) \
|
||||
xwininfo.$(OBJEXT)
|
||||
xwininfo_OBJECTS = $(am_xwininfo_OBJECTS)
|
||||
am__DEPENDENCIES_1 =
|
||||
xwininfo_DEPENDENCIES = $(am__DEPENDENCIES_1)
|
||||
@ -209,6 +210,8 @@ target_alias = @target_alias@
|
||||
AM_CFLAGS = $(XWININFO_CFLAGS)
|
||||
xwininfo_LDADD = $(XWININFO_LIBS)
|
||||
xwininfo_SOURCES = \
|
||||
clientwin.c \
|
||||
clientwin.h \
|
||||
dsimple.c \
|
||||
dsimple.h \
|
||||
xwininfo.c
|
||||
@ -328,6 +331,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)/xwininfo.Po@am__quote@
|
||||
|
||||
|
10
app/xwininfo/aclocal.m4
vendored
10
app/xwininfo/aclocal.m4
vendored
@ -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=
|
||||
|
||||
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
|
||||
|
214
app/xwininfo/clientwin.c
Normal file
214
app/xwininfo/clientwin.c
Normal file
@ -0,0 +1,214 @@
|
||||
/*
|
||||
* Copyright 2007 Kim woelders
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
static Atom atom_wm_state = None;
|
||||
|
||||
/*
|
||||
* Check if window has given property
|
||||
*/
|
||||
static Bool
|
||||
Window_Has_Property(Display * dpy, Window win, Atom atom)
|
||||
{
|
||||
Atom type_ret;
|
||||
int format_ret;
|
||||
unsigned char *prop_ret;
|
||||
unsigned long bytes_after, num_ret;
|
||||
|
||||
type_ret = None;
|
||||
prop_ret = NULL;
|
||||
XGetWindowProperty(dpy, win, atom, 0, 0, False, AnyPropertyType,
|
||||
&type_ret, &format_ret, &num_ret,
|
||||
&bytes_after, &prop_ret);
|
||||
if (prop_ret)
|
||||
XFree(prop_ret);
|
||||
|
||||
return (type_ret != None) ? True : False;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if window is viewable
|
||||
*/
|
||||
static Bool
|
||||
Window_Is_Viewable(Display * dpy, Window win)
|
||||
{
|
||||
Bool ok;
|
||||
XWindowAttributes xwa;
|
||||
|
||||
XGetWindowAttributes(dpy, win, &xwa);
|
||||
|
||||
ok = (xwa.class == InputOutput) && (xwa.map_state == IsViewable);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find a window that has WM_STATE set in the window tree below win.
|
||||
* Unmapped/unviewable windows are not considered valid matches.
|
||||
* Children are searched in top-down stacking order.
|
||||
* The first matching window is returned, None if no match is found.
|
||||
*/
|
||||
Window
|
||||
Find_Client_In_Children(Display * dpy, Window win)
|
||||
{
|
||||
Window root, parent;
|
||||
Window *children;
|
||||
unsigned int n_children;
|
||||
int i;
|
||||
|
||||
if (!XQueryTree(dpy, win, &root, &parent, &children, &n_children))
|
||||
return None;
|
||||
if (!children)
|
||||
return None;
|
||||
|
||||
/* Check each child for WM_STATE and other validity */
|
||||
win = None;
|
||||
for (i = (int) n_children - 1; i >= 0; i--) {
|
||||
if (!Window_Is_Viewable(dpy, children[i])) {
|
||||
children[i] = None; /* Don't bother descending into this one */
|
||||
continue;
|
||||
}
|
||||
if (!Window_Has_Property(dpy, children[i], atom_wm_state))
|
||||
continue;
|
||||
|
||||
/* Got one */
|
||||
win = children[i];
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* No children matched, now descend into each child */
|
||||
for (i = (int) n_children - 1; i >= 0; i--) {
|
||||
if (children[i] == None)
|
||||
continue;
|
||||
win = Find_Client_In_Children(dpy, children[i]);
|
||||
if (win != None)
|
||||
break;
|
||||
}
|
||||
|
||||
done:
|
||||
XFree(children);
|
||||
|
||||
return win;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find virtual roots (_NET_VIRTUAL_ROOTS)
|
||||
*/
|
||||
unsigned long *
|
||||
Find_Roots(Display * dpy, Window root, unsigned int *num)
|
||||
{
|
||||
Atom type_ret;
|
||||
int format_ret;
|
||||
unsigned char *prop_ret;
|
||||
unsigned long bytes_after, num_ret;
|
||||
Atom atom;
|
||||
|
||||
*num = 0;
|
||||
atom = XInternAtom(dpy, "_NET_VIRTUAL_ROOTS", False);
|
||||
if (!atom)
|
||||
return NULL;
|
||||
|
||||
type_ret = None;
|
||||
prop_ret = NULL;
|
||||
if (XGetWindowProperty(dpy, root, atom, 0, 0x7fffffff, False,
|
||||
XA_WINDOW, &type_ret, &format_ret, &num_ret,
|
||||
&bytes_after, &prop_ret) != Success)
|
||||
return NULL;
|
||||
|
||||
if (prop_ret && type_ret == XA_WINDOW && format_ret == 32) {
|
||||
*num = num_ret;
|
||||
return ((unsigned long *) prop_ret);
|
||||
}
|
||||
if (prop_ret)
|
||||
XFree(prop_ret);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find child window at pointer location
|
||||
*/
|
||||
static Window
|
||||
Find_Child_At_Pointer(Display * dpy, Window win)
|
||||
{
|
||||
Window root_return, child_return;
|
||||
int dummyi;
|
||||
unsigned int dummyu;
|
||||
|
||||
XQueryPointer(dpy, win, &root_return, &child_return,
|
||||
&dummyi, &dummyi, &dummyi, &dummyi, &dummyu);
|
||||
|
||||
return child_return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find client window at pointer location
|
||||
*
|
||||
* root is the root window.
|
||||
* subwin is the subwindow reported by a ButtonPress event on root.
|
||||
*
|
||||
* If the WM uses virtual roots subwin may be a virtual root.
|
||||
* If so, we descend the window stack at the pointer location and assume the
|
||||
* child is the client or one of its WM frame windows.
|
||||
* This will of course work only if the virtual roots are children of the real
|
||||
* root.
|
||||
*/
|
||||
Window
|
||||
Find_Client(Display * dpy, Window root, Window subwin)
|
||||
{
|
||||
unsigned long *roots;
|
||||
unsigned int i, n_roots;
|
||||
Window win;
|
||||
|
||||
/* Check if subwin is a virtual root */
|
||||
roots = Find_Roots(dpy, root, &n_roots);
|
||||
for (i = 0; i < n_roots; i++) {
|
||||
if (subwin != roots[i])
|
||||
continue;
|
||||
win = Find_Child_At_Pointer(dpy, subwin);
|
||||
if (win == None)
|
||||
return subwin; /* No child - Return virtual root. */
|
||||
subwin = win;
|
||||
break;
|
||||
}
|
||||
if (roots)
|
||||
XFree(roots);
|
||||
|
||||
if (atom_wm_state == None) {
|
||||
atom_wm_state = XInternAtom(dpy, "WM_STATE", False);
|
||||
if (!atom_wm_state)
|
||||
return subwin;
|
||||
}
|
||||
|
||||
/* Check if subwin has WM_STATE */
|
||||
if (Window_Has_Property(dpy, subwin, atom_wm_state))
|
||||
return subwin;
|
||||
|
||||
/* Attempt to find a client window in subwin's children */
|
||||
win = Find_Client_In_Children(dpy, subwin);
|
||||
if (win != None)
|
||||
return win; /* Found a client */
|
||||
|
||||
/* Did not find a client */
|
||||
return subwin;
|
||||
}
|
29
app/xwininfo/clientwin.h
Normal file
29
app/xwininfo/clientwin.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2007 Kim woelders
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
#ifndef _CLIENTWIN_H_
|
||||
#define _CLIENTWIN_H_
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
extern Window Find_Client(Display * dpy, Window root, Window target_win);
|
||||
|
||||
#endif
|
44
app/xwininfo/configure
vendored
44
app/xwininfo/configure
vendored
@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.59 for xwininfo 1.0.3.
|
||||
# Generated by GNU Autoconf 2.59 for xwininfo 1.0.4.
|
||||
#
|
||||
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
|
||||
#
|
||||
@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='xwininfo'
|
||||
PACKAGE_TARNAME='xwininfo'
|
||||
PACKAGE_VERSION='1.0.3'
|
||||
PACKAGE_STRING='xwininfo 1.0.3'
|
||||
PACKAGE_VERSION='1.0.4'
|
||||
PACKAGE_STRING='xwininfo 1.0.4'
|
||||
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
|
||||
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE PKG_CONFIG ac_pt_PKG_CONFIG XWININFO_CFLAGS XWININFO_LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX MISC_MAN_SUFFIX DRIVER_MAN_SUFFIX ADMIN_MAN_SUFFIX APP_MAN_DIR LIB_MAN_DIR FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR LIBOBJS LTLIBOBJS'
|
||||
@ -750,7 +750,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 xwininfo 1.0.3 to adapt to many kinds of systems.
|
||||
\`configure' configures xwininfo 1.0.4 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@ -816,7 +816,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of xwininfo 1.0.3:";;
|
||||
short | recursive ) echo "Configuration of xwininfo 1.0.4:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@ -946,7 +946,7 @@ fi
|
||||
test -n "$ac_init_help" && exit 0
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
xwininfo configure 1.0.3
|
||||
xwininfo configure 1.0.4
|
||||
generated by GNU Autoconf 2.59
|
||||
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
@ -960,7 +960,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 xwininfo $as_me 1.0.3, which was
|
||||
It was created by xwininfo $as_me 1.0.4, which was
|
||||
generated by GNU Autoconf 2.59. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@ -1558,7 +1558,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='xwininfo'
|
||||
VERSION='1.0.3'
|
||||
VERSION='1.0.4'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@ -3120,12 +3120,12 @@ if test -n "$PKG_CONFIG"; then
|
||||
pkg_cv_XWININFO_CFLAGS="$XWININFO_CFLAGS"
|
||||
else
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xmuu xext x11\"") >&5
|
||||
($PKG_CONFIG --exists --print-errors "xmuu xext x11") 2>&5
|
||||
{ (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xext x11\"") >&5
|
||||
($PKG_CONFIG --exists --print-errors "xext x11") 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; then
|
||||
pkg_cv_XWININFO_CFLAGS=`$PKG_CONFIG --cflags "xmuu xext x11" 2>/dev/null`
|
||||
pkg_cv_XWININFO_CFLAGS=`$PKG_CONFIG --cflags "xext x11" 2>/dev/null`
|
||||
else
|
||||
pkg_failed=yes
|
||||
fi
|
||||
@ -3138,12 +3138,12 @@ if test -n "$PKG_CONFIG"; then
|
||||
pkg_cv_XWININFO_LIBS="$XWININFO_LIBS"
|
||||
else
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xmuu xext x11\"") >&5
|
||||
($PKG_CONFIG --exists --print-errors "xmuu xext x11") 2>&5
|
||||
{ (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xext x11\"") >&5
|
||||
($PKG_CONFIG --exists --print-errors "xext x11") 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; then
|
||||
pkg_cv_XWININFO_LIBS=`$PKG_CONFIG --libs "xmuu xext x11" 2>/dev/null`
|
||||
pkg_cv_XWININFO_LIBS=`$PKG_CONFIG --libs "xext x11" 2>/dev/null`
|
||||
else
|
||||
pkg_failed=yes
|
||||
fi
|
||||
@ -3162,14 +3162,14 @@ else
|
||||
_pkg_short_errors_supported=no
|
||||
fi
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
XWININFO_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xmuu xext x11"`
|
||||
XWININFO_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xext x11"`
|
||||
else
|
||||
XWININFO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xmuu xext x11"`
|
||||
XWININFO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xext x11"`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$XWININFO_PKG_ERRORS" >&5
|
||||
|
||||
{ { echo "$as_me:$LINENO: error: Package requirements (xmuu xext x11) were not met:
|
||||
{ { echo "$as_me:$LINENO: error: Package requirements (xext x11) were not met:
|
||||
|
||||
$XWININFO_PKG_ERRORS
|
||||
|
||||
@ -3180,7 +3180,7 @@ Alternatively, you may set the environment variables XWININFO_CFLAGS
|
||||
and XWININFO_LIBS to avoid the need to call pkg-config.
|
||||
See the pkg-config man page for more details.
|
||||
" >&5
|
||||
echo "$as_me: error: Package requirements (xmuu xext x11) were not met:
|
||||
echo "$as_me: error: Package requirements (xext x11) were not met:
|
||||
|
||||
$XWININFO_PKG_ERRORS
|
||||
|
||||
@ -3369,7 +3369,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
|
||||
@ -3378,7 +3378,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
|
||||
@ -3773,7 +3773,7 @@ _ASBOX
|
||||
} >&5
|
||||
cat >&5 <<_CSEOF
|
||||
|
||||
This file was extended by xwininfo $as_me 1.0.3, which was
|
||||
This file was extended by xwininfo $as_me 1.0.4, which was
|
||||
generated by GNU Autoconf 2.59. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@ -3836,7 +3836,7 @@ _ACEOF
|
||||
|
||||
cat >>$CONFIG_STATUS <<_ACEOF
|
||||
ac_cs_version="\\
|
||||
xwininfo config.status 1.0.3
|
||||
xwininfo config.status 1.0.4
|
||||
configured by $0, generated by GNU Autoconf 2.59,
|
||||
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
@ -22,7 +22,7 @@ dnl
|
||||
dnl Process this file with autoconf to create configure.
|
||||
|
||||
AC_PREREQ([2.57])
|
||||
AC_INIT(xwininfo,[1.0.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xwininfo)
|
||||
AC_INIT(xwininfo,[1.0.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xwininfo)
|
||||
AM_INIT_AUTOMAKE([dist-bzip2])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
@ -34,7 +34,7 @@ AC_PROG_INSTALL
|
||||
AC_CHECK_FUNCS([strlcat])
|
||||
|
||||
# Checks for pkg-config packages
|
||||
PKG_CHECK_MODULES(XWININFO, xmuu xext x11)
|
||||
PKG_CHECK_MODULES(XWININFO, xext x11)
|
||||
AC_SUBST(XWININFO_CFLAGS)
|
||||
AC_SUBST(XWININFO_LIBS)
|
||||
|
||||
|
@ -41,6 +41,7 @@ from The Open Group.
|
||||
* Written by Mark Lillibridge. Last updated 7/1/87
|
||||
*/
|
||||
|
||||
#include "clientwin.h"
|
||||
#include "dsimple.h"
|
||||
|
||||
/*
|
||||
@ -233,7 +234,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;
|
||||
@ -272,6 +273,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);
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ void usage(void);
|
||||
* Send bugs, etc. to chariot@athena.mit.edu.
|
||||
*/
|
||||
|
||||
Window Select_Window(Display *);
|
||||
Window Select_Window(Display *, int);
|
||||
Window Window_With_Name(Display *, Window, char *);
|
||||
#ifdef __GNUC__
|
||||
void Fatal_Error(char *, ...) __attribute__((__noreturn__));
|
||||
|
@ -51,7 +51,6 @@ of the copyright holder.
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xos.h>
|
||||
#include <X11/extensions/shape.h>
|
||||
#include <X11/Xmu/WinUtil.h>
|
||||
#ifndef NO_I18N
|
||||
#include <X11/Xlocale.h>
|
||||
#endif
|
||||
@ -388,17 +387,7 @@ main(int argc, char **argv)
|
||||
printf("xwininfo: Please select the window about which you\n");
|
||||
printf(" would like information by clicking the\n");
|
||||
printf(" mouse in that window.\n");
|
||||
window = Select_Window(dpy);
|
||||
if (window && !frame) {
|
||||
Window root;
|
||||
int dummyi;
|
||||
unsigned int dummy;
|
||||
|
||||
if (XGetGeometry (dpy, window, &root, &dummyi, &dummyi,
|
||||
&dummy, &dummy, &dummy, &dummy) &&
|
||||
window != root)
|
||||
window = XmuClientWindow (dpy, window);
|
||||
}
|
||||
window = Select_Window(dpy, !frame);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user