summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-05-02 15:21:25 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-05-02 15:21:25 +0000
commit97c0f94f2fa0c7516104af6d0bc44471c9c77325 (patch)
treec6ea626952ba4b8f972abd98f224f12299f70998
parentd72ccec682feb2f78fc982ae552ef37d46152283 (diff)
update to xrandr 1.3.0
-rw-r--r--app/xrandr/ChangeLog367
-rw-r--r--app/xrandr/Makefile.am18
-rw-r--r--app/xrandr/Makefile.in71
-rw-r--r--app/xrandr/aclocal.m457
-rw-r--r--app/xrandr/config.h.in33
-rw-r--r--app/xrandr/configure766
-rw-r--r--app/xrandr/configure.ac12
-rw-r--r--app/xrandr/keystone.5c555
-rw-r--r--app/xrandr/xrandr.c729
-rw-r--r--app/xrandr/xrandr.man234
10 files changed, 2672 insertions, 170 deletions
diff --git a/app/xrandr/ChangeLog b/app/xrandr/ChangeLog
index 824eda7b8..9f89094d3 100644
--- a/app/xrandr/ChangeLog
+++ b/app/xrandr/ChangeLog
@@ -1,3 +1,370 @@
+commit beb228842c77fab4a446e028dd501a01f0fb3fd3
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Feb 17 13:45:32 2009 -0500
+
+ Allow zero replies from GetPanning to mean panning is unavailable.
+
+commit 9418f5523bd923b122f6e67c33c40e0e9c29ab50
+Author: Aaron Plattner <aplattner@nvidia.com>
+Date: Wed Mar 4 15:49:10 2009 -0800
+
+ Set the screen config on the correct screen.
+
+ Otherwise, "DISPLAY=:0.0 xrandr --screen 1 -s 1" fails.
+
+commit 39a16783a3d1c0c722b4b18fab60a91b9f6ed578
+Author: Matthias Hopf <mhopf@suse.de>
+Date: Fri Mar 6 14:49:43 2009 +0100
+
+ Revert "Move outputs among crtcs as necessary. Fixes 14570"
+
+ This reverts commit 4dcc8ae1a6903434def1a2706f7c68ff9e2a17c4.
+ The commit broke uncloning completely again.
+
+ Conflicts:
+
+ xrandr.c
+
+commit 880f045202d1e70368b855c3783604e19be946b8
+Author: Julien Cristau <jcristau@debian.org>
+Date: Sun Feb 1 14:39:30 2009 +0100
+
+ Bump to 1.2.99.4
+
+commit 010dfc4bdd309256aecd006bb2b5b6937c2a119c
+Author: Julien Cristau <jcristau@debian.org>
+Date: Sun Feb 1 14:34:15 2009 +0100
+
+ Document the --primary and --noprimary options
+
+commit 48014498d275a9aab986b4bf295538a5b38ddfeb
+Author: Julien Cristau <jcristau@debian.org>
+Date: Sun Feb 1 14:12:21 2009 +0100
+
+ Document the --current option
+
+commit 909defc8a2b009ab845d875ba10e1ca01fb9d648
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Jan 30 20:37:34 2009 -0800
+
+ Add --noprimary option
+
+commit 6c70e0ee693ea293e8674d049249b462f3d36855
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Jan 30 20:11:10 2009 -0800
+
+ Add --primary option
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 77891e7900765a320ad3d43b56bbb1f3081b6582
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Jan 30 20:11:02 2009 -0800
+
+ Add --nograb option
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 6f3e2bb207cff069791811ef2bbe7798759ed810
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Dec 9 21:26:50 2008 -0800
+
+ Add --current option to use new XRRGetScreenResourcesCurrent API
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit d98d1f4055d8fbae1dc8d8c54467bfef21010694
+Author: Matthias Hopf <mhopf@suse.de>
+Date: Fri Jan 30 17:46:05 2009 +0100
+
+ Several fatal() were missing \n.
+
+commit 9ea6e4210d49c13991a7d07e54f6f59e3dc8ce72
+Author: Éric Piel <E.A.B.Piel@tudelft.nl>
+Date: Mon Jan 19 16:18:46 2009 +0100
+
+ Add docs for --transform and --scale.
+
+ The new --transform and --scale options were added, but not yet
+ documented. This includes also an example of usage of panning and
+ scaling at the same time.
+
+commit 4d381d6a88fe147f8b6eabd765a2f42c6402d8c6
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date: Mon Jan 26 16:40:59 2009 -0200
+
+ Correct make distcheck and gcc/sparse warnings.
+
+commit 7509ecb290689e0b1d5e1000c9fbd312f1efb4ca
+Author: Maarten Maathuis <madman2003@gmail.com>
+Date: Mon Jan 5 19:47:21 2009 +0100
+
+ Stay away from doublescan modes unless a refresh rate is specified.
+
+commit f77ad847c0d3f8f0c6e8ffbf0bec39e5e9c5ded0
+Author: Maarten Maathuis <madman2003@gmail.com>
+Date: Mon Dec 22 19:46:24 2008 +0100
+
+ Fix gamma computation.
+
+ - The previous version sometimes overflowed.
+
+commit 5ddde7151841a8db99a2f38689a176114b2a45e5
+Author: Matthias Hopf <mhopf@suse.de>
+Date: Thu Dec 18 16:09:39 2008 +0100
+
+ Print multiple Atom and INT32 properties.
+
+ Improve output formating of strings.
+
+commit 96af64f0de71f4149740b486baaefca744bb1bc1
+Author: Maarten Maathuis <madman2003@gmail.com>
+Date: Wed Dec 17 17:18:14 2008 +0100
+
+ randr-1.2: support gamma changes.
+
+commit 9b7a2a3d4ac7891bd5372a581e6a55a1c81497ef
+Author: Matthias Hopf <mhopf@suse.de>
+Date: Mon Dec 15 20:39:43 2008 +0100
+
+ Bump to 1.2.99.3
+
+commit e80add8a407a9327bda209ff11a97dc3336e0cab
+Author: Matthias Hopf <mhopf@suse.de>
+Date: Mon Dec 15 21:00:55 2008 +0100
+
+ Add keystone.5c to EXTRA_DIST
+
+commit c98591b0bf4753c4c075eccde6023ef644f8bf96
+Author: Matthias Hopf <mhopf@suse.de>
+Date: Mon Dec 15 20:36:40 2008 +0100
+
+ Don't trash panning area, except if --panning or --fb is given.
+
+ Almost anything used to reduce the screen size to the current mode size, which
+ is counter-productive when panning is active.
+
+commit 8cb63b6df9e46e8b06a57cb54ad460355b604399
+Author: Matthias Hopf <mhopf@suse.de>
+Date: Thu Dec 11 17:09:47 2008 +0100
+
+ Panning tracking areas describe full screen if set to 0. Use it as default.
+
+ Also improve reduced output on default tracking and borders.
+
+commit b5efbb31ec7c27895507add4497dbfc87f930bb3
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Dec 8 16:37:59 2008 -0500
+
+ Accept --props synonym for --prop
+
+commit 57cabac91099a8abd5afad75de64e54930c078ec
+Author: Matthias Hopf <mhopf@suse.de>
+Date: Mon Dec 8 12:24:37 2008 +0100
+
+ Only set transforms if actually changed.
+
+ Re-enables other crtc settings if transforms are not supported.
+
+commit 970f689651fc86fa7a2ba24f0fab5f86f01af349
+Author: Matthias Hopf <mhopf@suse.de>
+Date: Thu Dec 4 17:47:05 2008 +0100
+
+ Add manpage entry.
+
+commit d030ae78e8516b916e9ea1ea81e3b4859bf35875
+Author: Matthias Hopf <mhopf@suse.de>
+Date: Thu Dec 4 15:57:22 2008 +0100
+
+ Bump to 1.2.99.2, RandR requirements to 1.2.99.2
+
+commit f6b5862f87ba7e1729c46136ef7754a06301853f
+Author: Matthias Hopf <mhopf@suse.de>
+Date: Fri Nov 28 17:16:11 2008 +0100
+
+ Add panning support.
+
+commit 1dc67ca918446cb7db4819f60f36e7bc6f4c047b
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date: Sat Dec 6 11:40:53 2008 +0100
+
+ Don't use GNU make only constructs.
+
+commit 7963d4217c12d2e4b0c38ad4ff185462784609f7
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Dec 1 23:27:51 2008 +0100
+
+ Require libXrandr 1.2.91
+
+commit ba78e14c8c43a141fc5227e7bb75d6cfd0f70dba
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Dec 1 21:45:47 2008 +0100
+
+ Fix build outside of the source dir
+
+commit 63ba316bcbe8ad61ba63d9fe62c82e7d56dcc399
+Merge: a813c4d... 1b95e32...
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Dec 1 21:33:35 2008 +0100
+
+ Merge branch 'transform-proposal' of git.freedesktop.org:/git/xorg/app/xrandr
+
+commit 1b95e32b4b0a4a114e0fbebe8a18316d2f9010cf
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Nov 14 14:14:24 2008 -0800
+
+ Add --scale and --transform to --help output
+
+commit e9a5d1c598cd0440f062240430a9b86b4d514ada
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Nov 14 14:13:51 2008 -0800
+
+ Check return value from XRRGetCrtcTransform
+
+ XRRGetCrtcTransform will return 0 if the X server does not support this
+ request.
+
+commit a813c4da7f0b166ee9001fa97c5d8d64e5b5b560
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Tue Aug 19 09:39:00 2008 -0700
+
+ Man page typo fix
+
+commit 8ef4595aef15b7326822849a50c273f2a2b4ba30
+Author: Julien Cristau <jcristau@debian.org>
+Date: Fri Aug 15 21:23:13 2008 +0200
+
+ Manpage typo fixes
+
+commit 977275a13be0687efc3db1fd3763174ff1256210
+Author: Eric Piel <E.A.B.Piel@tudelft.nl>
+Date: Sun Aug 10 23:28:25 2008 +0200
+
+ update the manpage
+
+ Describe all the options supported, including: --dryrun, -display,
+ --q1, --q12, and --rate for 1.1
+ Describe all short and long version of the option.
+ Use the usual man style for the option arugments.
+ Move the four --*mode options out of the output section as they are
+ independant of an output.
+ Mention cvt for computing modelines.
+ Gives some examples.
+
+commit 3046799a06ecb79211ef0f4a2db9de4eec7233fb
+Author: Egbert Eich <eich@freedesktop.org>
+Date: Sun Aug 3 13:24:49 2008 +0200
+
+ Fix for 64bit: feed a pointer to the right size variable to scanf().
+
+ XID is unsigned long, however %x in scanf takes a pointer to an unsigned int.
+ Thus with XID xid, a sscanf(..., "0x%x", &xid) will most likely produce the
+ wrong results.
+
+commit 0d2082e9eb25cb7410309eed908b7f95abb8da79
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Apr 1 23:46:02 2008 -0700
+
+ Exit when select output is not available
+
+commit 18a189993b3df8bc54a79e0d62240ef203d6f34f
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Apr 1 23:44:50 2008 -0700
+
+ Fix up xkeystone to use current screen/output settings
+
+commit 9e8860f9231926090462ea20132cc9e1d64e5fe4
+Author: Keith Packard <keithp@keithp.com>
+Date: Sun Mar 30 19:03:53 2008 -0700
+
+ Execute xrandr to set keystone correction
+
+commit 206bfbea4ebe854fdfa66e8a6fbd9296b6004c0e
+Author: Keith Packard <keithp@keithp.com>
+Date: Sun Mar 30 19:03:29 2008 -0700
+
+ add --transform none to reset to identity
+
+commit 443e1f80c885133ae6df590f1a7663833c76b7f3
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Mar 21 23:29:41 2008 -0700
+
+ Build and install xkeystone program from keystone.5c
+
+commit a7a7eea510b5a87c1e12516fadae4d13bd26e0a0
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Mar 21 23:26:30 2008 -0700
+
+ Track toolkit name change (chrome->nichrome)
+
+commit 74dae9d4b06369a1863e7a68b7b3772751e06ff1
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Mar 21 03:17:44 2008 -0700
+
+ Add keystone.5c program to help compute transforms.
+
+commit 46bd35dd9004c0f9f47dc44b77a8c28e3ab7ced1
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Mar 21 03:17:40 2008 -0700
+
+ Make screen undersize a warning instead of an error
+
+commit b816bf38b418618c2f1cb5ded09aa3b346f8eb15
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Mar 18 16:04:34 2008 -0700
+
+ Add --transform to pass arbitrary transforms to the server
+
+commit 3809884530223e32f7026ec987257cb91e2122a9
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Mar 18 16:04:22 2008 -0700
+
+ Eliminate inverse matrix from randr transform protocol
+
+ It is easier, and potentially more precise, to compute the inverse in the
+ server where everything can eventually be kept in floating point form.
+
+commit 854a7c2916455fec5ec1ba87576e26706d151381
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Mar 17 13:59:40 2008 -0700
+
+ Transform mode bounds when computing sizes.
+
+ Ensure screen sizes are compared with projected mode image, including
+ rotation and transformation.
+
+commit bed3da4feaa505a5b50a4c94b0e6661bdac1fcbd
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Mar 15 00:35:08 2008 -0700
+
+ Manage transform filters. Use bilinear for non-identity scale.
+
+ This involved creating a compound transform datatype to hold all of the
+ relevant transform and filter information. Adding arbitrary transforms
+ should be fairly easy at this point.
+
+commit ba35bb5d306f4edf9a47b92f249132a0814f5db1
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Mar 10 21:19:41 2008 -0700
+
+ Add output scaling using the 1.3 transform requests
+
+commit 4dcc8ae1a6903434def1a2706f7c68ff9e2a17c4
+Author: Hong Liu <hong.liu@intel.com>
+Date: Mon Mar 10 21:37:09 2008 -0700
+
+ Move outputs among crtcs as necessary. Fixes 14570
+
+ This patch makes new requests override existing crtc allocations. Outputs
+ with restricted crtc usage can now force existing outputs to switch
+ automatcially.
+
+commit 7465357396e2f32325791e27f28cbbe9753db3ab
+Author: Adam Jackson <ajax@redhat.com>
+Date: Fri Mar 7 16:38:28 2008 -0500
+
+ xrandr 1.2.3
+
commit 4450756d2d1d86f3c0bfaef81f6265f795468f32
Author: Brice Goglin <bgoglin@debian.org>
Date: Sat Dec 15 00:59:00 2007 +0100
diff --git a/app/xrandr/Makefile.am b/app/xrandr/Makefile.am
index 5772a0295..bc22c6a70 100644
--- a/app/xrandr/Makefile.am
+++ b/app/xrandr/Makefile.am
@@ -21,6 +21,15 @@
bin_PROGRAMS = xrandr
+bin_SCRIPTS = xkeystone
+
+xkeystone: keystone.5c
+ (echo '#!/usr/bin/env nickle'; cat ${srcdir}/keystone.5c) > $@
+ chmod +x $@
+
+clean-local:
+ rm -f xkeystone
+
AM_CFLAGS = $(XRANDR_CFLAGS)
xrandr_LDADD = $(XRANDR_LIBS)
@@ -34,9 +43,8 @@ appmandir = $(APP_MAN_DIR)
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
-EXTRA_DIST = $(appman_PRE) ChangeLog autogen.sh xrandr_test.pl
+EXTRA_DIST = $(appman_PRE) xrandr_test.pl keystone.5c
CLEANFILES = $(appman_DATA)
-MAINTAINERCLEANFILES = ChangeLog
SED = sed
@@ -62,11 +70,13 @@ SUFFIXES = .$(APP_MAN_SUFFIX) .man
.man.$(APP_MAN_SUFFIX):
sed $(MAN_SUBSTS) < $< > $@
+EXTRA_DIST += ChangeLog
+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)
+ $(CHANGELOG_CMD)
dist-hook: ChangeLog
diff --git a/app/xrandr/Makefile.in b/app/xrandr/Makefile.in
index 3f08b6a30..ef05578ec 100644
--- a/app/xrandr/Makefile.in
+++ b/app/xrandr/Makefile.in
@@ -36,6 +36,7 @@
# PERFORMANCE OF THIS SOFTWARE.
+
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@@ -73,13 +74,16 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
mkinstalldirs = $(SHELL) $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \
+ "$(DESTDIR)$(appmandir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_xrandr_OBJECTS = xrandr.$(OBJEXT)
xrandr_OBJECTS = $(am_xrandr_OBJECTS)
am__DEPENDENCIES_1 =
xrandr_DEPENDENCIES = $(am__DEPENDENCIES_1)
+binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(bin_SCRIPTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -109,7 +113,6 @@ am__remove_distdir = \
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
-distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
@@ -125,7 +128,10 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
@@ -134,6 +140,7 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EXEEXT = @EXEEXT@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
@@ -185,6 +192,7 @@ build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
+distcleancheck_listfiles = @distcleancheck_listfiles@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
@@ -206,6 +214,7 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+bin_SCRIPTS = xkeystone
AM_CFLAGS = $(XRANDR_CFLAGS)
xrandr_LDADD = $(XRANDR_LIBS)
xrandr_SOURCES = \
@@ -216,9 +225,8 @@ appman_PRE = \
appmandir = $(APP_MAN_DIR)
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
-EXTRA_DIST = $(appman_PRE) ChangeLog autogen.sh xrandr_test.pl
+EXTRA_DIST = $(appman_PRE) xrandr_test.pl keystone.5c ChangeLog
CLEANFILES = $(appman_DATA)
-MAINTAINERCLEANFILES = ChangeLog
SED = sed
# Strings to replace in man pages
@@ -238,6 +246,7 @@ MAN_SUBSTS = \
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
SUFFIXES = .$(APP_MAN_SUFFIX) .man
+MAINTAINERCLEANFILES = ChangeLog
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@@ -319,6 +328,25 @@ clean-binPROGRAMS:
xrandr$(EXEEXT): $(xrandr_OBJECTS) $(xrandr_DEPENDENCIES)
@rm -f xrandr$(EXEEXT)
$(LINK) $(xrandr_LDFLAGS) $(xrandr_OBJECTS) $(xrandr_LDADD) $(LIBS)
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -539,9 +567,9 @@ distcleancheck: distclean
exit 1; } >&2
check-am: all-am
check: check-am
-all-am: Makefile $(PROGRAMS) $(DATA) config.h
+all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) config.h
installdirs:
- for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"; do \
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
@@ -572,7 +600,7 @@ maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-local mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
@@ -593,7 +621,7 @@ info-am:
install-data-am: install-appmanDATA
-install-exec-am: install-binPROGRAMS
+install-exec-am: install-binPROGRAMS install-binSCRIPTS
install-info: install-info-am
@@ -621,23 +649,31 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-appmanDATA uninstall-binPROGRAMS \
- uninstall-info-am
+ uninstall-binSCRIPTS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
- clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
- dist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \
- distclean distclean-compile distclean-generic distclean-hdr \
- distclean-tags distcleancheck distdir distuninstallcheck dvi \
- dvi-am html html-am info info-am install install-am \
- install-appmanDATA install-binPROGRAMS install-data \
+ clean-binPROGRAMS clean-generic clean-local ctags dist \
+ dist-all dist-bzip2 dist-gzip dist-hook dist-shar dist-tarZ \
+ dist-zip distcheck distclean distclean-compile \
+ distclean-generic distclean-hdr distclean-tags distcleancheck \
+ distdir distuninstallcheck dvi dvi-am html html-am info \
+ info-am install install-am install-appmanDATA \
+ install-binPROGRAMS install-binSCRIPTS install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-appmanDATA uninstall-binPROGRAMS \
- uninstall-info-am
+ uninstall-binSCRIPTS uninstall-info-am
+
+
+xkeystone: keystone.5c
+ (echo '#!/usr/bin/env nickle'; cat ${srcdir}/keystone.5c) > $@
+ chmod +x $@
+clean-local:
+ rm -f xkeystone
.man.$(APP_MAN_SUFFIX):
sed $(MAN_SUBSTS) < $< > $@
@@ -645,8 +681,7 @@ uninstall-am: uninstall-appmanDATA uninstall-binPROGRAMS \
.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)
+ $(CHANGELOG_CMD)
dist-hook: ChangeLog
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/app/xrandr/aclocal.m4 b/app/xrandr/aclocal.m4
index 48f9f8de2..e6e4bfd9e 100644
--- a/app/xrandr/aclocal.m4
+++ b/app/xrandr/aclocal.m4
@@ -995,6 +995,7 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
+dnl xorg-macros.m4. Generated from xorg-macros.m4.in:xorgversion.m4 by configure.
dnl
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
dnl
@@ -1042,7 +1043,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.6
+ [XORG_MACROS_version=1.2.1
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
@@ -1076,6 +1077,10 @@ else
if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
RAWCPPFLAGS=-undef
AC_MSG_RESULT([yes])
+ # under Cygwin unix is still defined even with -undef
+ elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+ RAWCPPFLAGS="-undef -ansi"
+ AC_MSG_RESULT([yes, with -ansi])
else
AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
fi
@@ -1188,7 +1193,9 @@ AC_SUBST([ADMIN_MAN_DIR])
# Whether or not the necessary tools and files are found can be checked
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
AC_DEFUN([XORG_CHECK_LINUXDOC],[
-XORG_SGML_PATH=$prefix/share/sgml
+if test x$XORG_SGML_PATH = x ; then
+ XORG_SGML_PATH=$prefix/share/sgml
+fi
HAVE_DEFS_ENT=
if test x"$cross_compiling" = x"yes" ; then
@@ -1244,7 +1251,9 @@ AC_SUBST(MAKE_HTML)
# indicates whether the necessary tools and files are found and, if set,
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
AC_DEFUN([XORG_CHECK_DOCBOOK],[
-XORG_SGML_PATH=$prefix/share/sgml
+if test x$XORG_SGML_PATH = x ; then
+ XORG_SGML_PATH=$prefix/share/sgml
+fi
HAVE_DEFS_ENT=
BUILDTXTDOC=no
BUILDPDFDOC=no
@@ -1421,6 +1430,31 @@ AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
]) # XORG_LINT_LIBRARY
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC])
+if test "x$GCC" = xyes ; then
+ CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+ case `gcc -dumpversion` in
+ 3.4.* | 4.*)
+ CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
+ ;;
+ esac
+else
+ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+ if test "x$SUNCC" = "xyes"; then
+ CWARNFLAGS="-v"
+ fi
+fi
+AC_SUBST(CWARNFLAGS)
+]) # XORG_CWARNFLAGS
dnl Copyright 2005 Red Hat, Inc
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
@@ -1483,3 +1517,20 @@ AC_DEFUN([XORG_RELEASE_VERSION],[
[Patch version of this package])
])
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+# Arrange that distcleancheck ignores ChangeLog left over by distclean.
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(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)"
+AC_SUBST([CHANGELOG_CMD])
+AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
+]) # XORG_CHANGELOG
+
diff --git a/app/xrandr/config.h.in b/app/xrandr/config.h.in
index 1ca40928b..f99372b9c 100644
--- a/app/xrandr/config.h.in
+++ b/app/xrandr/config.h.in
@@ -1,5 +1,35 @@
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
/* Name of package */
#undef PACKAGE
@@ -27,5 +57,8 @@
/* Patch version of this package */
#undef PACKAGE_VERSION_PATCHLEVEL
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
/* Version number of package */
#undef VERSION
diff --git a/app/xrandr/configure b/app/xrandr/configure
index 6627ff3e5..93bf6fa6a 100644
--- a/app/xrandr/configure
+++ b/app/xrandr/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for xrandr 1.2.3.
+# Generated by GNU Autoconf 2.59 for xrandr 1.3.0.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
#
@@ -269,11 +269,48 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='xrandr'
PACKAGE_TARNAME='xrandr'
-PACKAGE_VERSION='1.2.3'
-PACKAGE_STRING='xrandr 1.2.3'
+PACKAGE_VERSION='1.3.0'
+PACKAGE_STRING='xrandr 1.3.0'
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 XRANDR_CFLAGS XRANDR_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'
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+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 CPP EGREP CWARNFLAGS PKG_CONFIG ac_pt_PKG_CONFIG XRANDR_CFLAGS XRANDR_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 CHANGELOG_CMD distcleancheck_listfiles LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -730,6 +767,10 @@ ac_env_CPPFLAGS_set=${CPPFLAGS+set}
ac_env_CPPFLAGS_value=$CPPFLAGS
ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
ac_env_PKG_CONFIG_set=${PKG_CONFIG+set}
ac_env_PKG_CONFIG_value=$PKG_CONFIG
ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set}
@@ -750,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 xrandr 1.2.3 to adapt to many kinds of systems.
+\`configure' configures xrandr 1.3.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -816,7 +857,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xrandr 1.2.3:";;
+ short | recursive ) echo "Configuration of xrandr 1.3.0:";;
esac
cat <<\_ACEOF
@@ -841,6 +882,7 @@ Some influential environment variables:
nonstandard directory <lib dir>
CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
headers in a nonstandard directory <include dir>
+ CPP C preprocessor
PKG_CONFIG path to pkg-config utility
XRANDR_CFLAGS
C compiler flags for XRANDR, overriding pkg-config
@@ -945,7 +987,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-xrandr configure 1.2.3
+xrandr configure 1.3.0
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -959,7 +1001,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 xrandr $as_me 1.2.3, which was
+It was created by xrandr $as_me 1.3.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1557,7 +1599,7 @@ fi
# Define the identity of the package.
PACKAGE='xrandr'
- VERSION='1.2.3'
+ VERSION='1.3.0'
cat >>confdefs.h <<_ACEOF
@@ -1712,6 +1754,31 @@ fi
+# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
+
+
+ XORG_MACROS_needed_version=1.2
+ 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/\..*$//'`
+ 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.2.1
+ 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
+ { { echo "$as_me:$LINENO: error: configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x" >&5
+echo "$as_me: error: configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
+ { { echo "$as_me:$LINENO: error: configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer" >&5
+echo "$as_me: error: configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ echo "$as_me:$LINENO: result: yes, $XORG_MACROS_version" >&5
+echo "${ECHO_T}yes, $XORG_MACROS_version" >&6
+
+
ac_config_headers="$ac_config_headers config.h"
@@ -2899,6 +2966,649 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+if test "x$GCC" = xyes ; then
+ CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+ case `gcc -dumpversion` in
+ 3.4.* | 4.*)
+ CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
+ ;;
+ esac
+else
+ echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
+echo $ECHO_N "checking whether __SUNPRO_C is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __SUNPRO_C
+ char *p = (char *) __SUNPRO_C;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl___SUNPRO_C=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl___SUNPRO_C=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
+echo "${ECHO_T}$ac_cv_have_decl___SUNPRO_C" >&6
+if test $ac_cv_have_decl___SUNPRO_C = yes; then
+ SUNCC="yes"
+else
+ SUNCC="no"
+fi
+
+ if test "x$SUNCC" = "xyes"; then
+ CWARNFLAGS="-v"
+ fi
+fi
+
+
+
+
+echo "$as_me:$LINENO: checking for floor in -lm" >&5
+echo $ECHO_N "checking for floor in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_floor+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char floor ();
+int
+main ()
+{
+floor ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_m_floor=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_floor=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_floor" >&5
+echo "${ECHO_T}$ac_cv_lib_m_floor" >&6
+if test $ac_cv_lib_m_floor = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
# Checks for pkg-config packages
@@ -3015,12 +3725,12 @@ if test -n "$PKG_CONFIG"; then
pkg_cv_XRANDR_CFLAGS="$XRANDR_CFLAGS"
else
if test -n "$PKG_CONFIG" && \
- { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xrandr >= 1.2.0 xrender x11\"") >&5
- ($PKG_CONFIG --exists --print-errors "xrandr >= 1.2.0 xrender x11") 2>&5
+ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xrandr >= 1.2.99.3 xrender x11\"") >&5
+ ($PKG_CONFIG --exists --print-errors "xrandr >= 1.2.99.3 xrender x11") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
- pkg_cv_XRANDR_CFLAGS=`$PKG_CONFIG --cflags "xrandr >= 1.2.0 xrender x11" 2>/dev/null`
+ pkg_cv_XRANDR_CFLAGS=`$PKG_CONFIG --cflags "xrandr >= 1.2.99.3 xrender x11" 2>/dev/null`
else
pkg_failed=yes
fi
@@ -3033,12 +3743,12 @@ if test -n "$PKG_CONFIG"; then
pkg_cv_XRANDR_LIBS="$XRANDR_LIBS"
else
if test -n "$PKG_CONFIG" && \
- { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xrandr >= 1.2.0 xrender x11\"") >&5
- ($PKG_CONFIG --exists --print-errors "xrandr >= 1.2.0 xrender x11") 2>&5
+ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xrandr >= 1.2.99.3 xrender x11\"") >&5
+ ($PKG_CONFIG --exists --print-errors "xrandr >= 1.2.99.3 xrender x11") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
- pkg_cv_XRANDR_LIBS=`$PKG_CONFIG --libs "xrandr >= 1.2.0 xrender x11" 2>/dev/null`
+ pkg_cv_XRANDR_LIBS=`$PKG_CONFIG --libs "xrandr >= 1.2.99.3 xrender x11" 2>/dev/null`
else
pkg_failed=yes
fi
@@ -3057,14 +3767,14 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- XRANDR_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xrandr >= 1.2.0 xrender x11"`
+ XRANDR_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xrandr >= 1.2.99.3 xrender x11"`
else
- XRANDR_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xrandr >= 1.2.0 xrender x11"`
+ XRANDR_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xrandr >= 1.2.99.3 xrender x11"`
fi
# Put the nasty error message in config.log where it belongs
echo "$XRANDR_PKG_ERRORS" >&5
- { { echo "$as_me:$LINENO: error: Package requirements (xrandr >= 1.2.0 xrender x11) were not met:
+ { { echo "$as_me:$LINENO: error: Package requirements (xrandr >= 1.2.99.3 xrender x11) were not met:
$XRANDR_PKG_ERRORS
@@ -3075,7 +3785,7 @@ Alternatively, you may set the environment variables XRANDR_CFLAGS
and XRANDR_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 (xrandr >= 1.2.0 xrender x11) were not met:
+echo "$as_me: error: Package requirements (xrandr >= 1.2.99.3 xrender x11) were not met:
$XRANDR_PKG_ERRORS
@@ -3116,6 +3826,7 @@ else
echo "${ECHO_T}yes" >&6
:
fi
+XRANDR_CFLAGS="$CWARNFLAGS $XRANDR_CFLAGS"
@@ -3284,6 +3995,14 @@ _ACEOF
+CHANGELOG_CMD="(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)"
+
+distcleancheck_listfiles='find . -type f ! -name ChangeLog -print'
+
+
+
ac_config_files="$ac_config_files Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -3668,7 +4387,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by xrandr $as_me 1.2.3, which was
+This file was extended by xrandr $as_me 1.3.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3731,7 +4450,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-xrandr config.status 1.2.3
+xrandr config.status 1.3.0
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@@ -3970,6 +4689,9 @@ s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
s,@CCDEPMODE@,$CCDEPMODE,;t t
s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@CWARNFLAGS@,$CWARNFLAGS,;t t
s,@PKG_CONFIG@,$PKG_CONFIG,;t t
s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
s,@XRANDR_CFLAGS@,$XRANDR_CFLAGS,;t t
@@ -3994,6 +4716,8 @@ s,@FILE_MAN_DIR@,$FILE_MAN_DIR,;t t
s,@MISC_MAN_DIR@,$MISC_MAN_DIR,;t t
s,@DRIVER_MAN_DIR@,$DRIVER_MAN_DIR,;t t
s,@ADMIN_MAN_DIR@,$ADMIN_MAN_DIR,;t t
+s,@CHANGELOG_CMD@,$CHANGELOG_CMD,;t t
+s,@distcleancheck_listfiles@,$distcleancheck_listfiles,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
diff --git a/app/xrandr/configure.ac b/app/xrandr/configure.ac
index 126a51b63..95d6cdacb 100644
--- a/app/xrandr/configure.ac
+++ b/app/xrandr/configure.ac
@@ -21,21 +21,29 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ([2.57])
-AC_INIT(xrandr,[1.2.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xrandr)
+AC_INIT(xrandr,[1.3.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xrandr)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
+# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
+m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.2)
+
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_INSTALL
+XORG_CWARNFLAGS
+AC_CHECK_LIB(m,floor)
# Checks for pkg-config packages
-PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2.0 xrender x11)
+PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2.99.3 xrender x11)
+XRANDR_CFLAGS="$CWARNFLAGS $XRANDR_CFLAGS"
AC_SUBST(XRANDR_CFLAGS)
AC_SUBST(XRANDR_LIBS)
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
+XORG_CHANGELOG
AC_OUTPUT([Makefile])
diff --git a/app/xrandr/keystone.5c b/app/xrandr/keystone.5c
new file mode 100644
index 000000000..228c02034
--- /dev/null
+++ b/app/xrandr/keystone.5c
@@ -0,0 +1,555 @@
+/*
+ * Copyright © 2008 Keith Packard
+ *
+ * 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.
+ */
+
+autoload Process;
+autoload Nichrome;
+autoload Nichrome::Box;
+autoload Nichrome::Label;
+autoload Nichrome::Button;
+
+extend namespace Nichrome {
+ public namespace Quad {
+ public typedef quad_t;
+ public typedef widget_t + struct {
+ point_t[4] p;
+ real line_width;
+ real corner_diameter;
+ rgba_color_t line_color;
+ rgba_color_t corner_color;
+ bool down;
+ bool started;
+ int active;
+ void(&quad_t) callback;
+ } quad_t;
+
+ protected void outline (cairo_t cr, &quad_t quad) {
+ for (int i = 0; i < dim (quad.p); i++) {
+ arc (cr, quad.p[i].x, quad.p[i].y,
+ quad.corner_diameter / 2, 0, 2 * pi);
+ close_path (cr);
+ }
+ }
+
+ void text_at (cairo_t cr, point_t p, string text) {
+ text_extents_t e = text_extents (cr, text);
+ p.x = p.x - e.width / 2 - e.x_bearing;
+ p.y = p.y - e.height / 2 - e.y_bearing;
+ move_to (cr, p.x, p.y);
+ show_text (cr, text);
+ }
+
+ protected void draw (cairo_t cr, &quad_t quad) {
+ if (!quad.started) {
+ quad.p[2].x = quad.p[1].x = quad.geometry.width;
+ quad.p[3].y = quad.p[2].y = quad.geometry.height;
+ quad.started = true;
+ }
+ rectangle (cr, 0, 0, quad.geometry.width, quad.geometry.height);
+ set_source_rgba (cr, 0, 0, 0, .25);
+ fill (cr);
+ for (int i = 0; i < dim (quad.p); i++)
+ line_to (cr, quad.p[i].x, quad.p[i].y);
+ close_path (cr);
+ set_line_width (cr, quad.line_width);
+ set_source_rgba (cr, quad.line_color.red, quad.line_color.green,
+ quad.line_color.blue, quad.line_color.alpha);
+ set_line_join (cr, line_join_t.ROUND);
+ stroke (cr);
+ set_source_rgba (cr, quad.corner_color.red, quad.corner_color.green,
+ quad.corner_color.blue, quad.corner_color.alpha);
+ outline (cr, &quad);
+ fill (cr);
+ set_source_rgba (cr, 1, 1, 1, 1);
+ for (int i = 0; i < dim (quad.p); i++)
+ text_at (cr, quad.p[i], sprintf ("%d", i));
+ }
+
+ int nearest (&quad_t quad, point_t p) {
+ real best_dist2 = 0;
+ int best = 0;
+
+ for (int i = 0; i < dim (quad.p); i++) {
+ real dist2 = ((p.x - quad.p[i].x) ** 2 +
+ (p.y - quad.p[i].y) ** 2);
+ if (i == 0 || dist2 < best_dist2) {
+ best_dist2 = dist2;
+ best = i;
+ }
+ }
+ return best;
+ }
+
+ protected void button (&quad_t quad, &button_event_t event) {
+ enum switch (event.type) {
+ case press:
+ quad.down = true;
+ quad.active = nearest (&quad, event);
+ break;
+ case release:
+ quad.down = false;
+ break;
+ default:
+ break;
+ }
+ }
+
+ protected void motion (&quad_t quad, &motion_event_t motion) {
+ if (quad.down) {
+ motion.x = max (0, min (quad.geometry.width, motion.x));
+ motion.y = max (0, min (quad.geometry.height, motion.y));
+ quad.p[quad.active].x = motion.x;
+ quad.p[quad.active].y = motion.y;
+ quad.callback (&quad);
+ Widget::reoutline (&quad);
+ Widget::redraw (&quad);
+ }
+ }
+
+ protected void configure (&quad_t quad,
+ rect_t geometry)
+ {
+ if (quad.geometry.width > 0 && quad.geometry.height > 0)
+ {
+ real x_scale = geometry.width / quad.geometry.width;
+ real y_scale = geometry.height / quad.geometry.height;
+ for (int i = 0; i< 4; i++) {
+ quad.p[i].x *= x_scale;
+ quad.p[i].y *= y_scale;
+ }
+ }
+ Widget::configure (&quad, geometry);
+ quad.callback (&quad);
+ }
+
+ protected void init (&quad_t quad,
+ &nichrome_t nichrome,
+ void (&quad_t) callback) {
+ Widget::init (&nichrome, &quad);
+ quad.outline = outline;
+ quad.draw = draw;
+ quad.button = button;
+ quad.motion = motion;
+ quad.configure = configure;
+ quad.p = (point_t[4]) {
+ { x = 0, y = 0 } ...
+ };
+ quad.line_color = (rgba_color_t) {
+ red = 1, green = 0, blue = 0, alpha = .5
+ };
+ quad.line_width = 10;
+ quad.corner_color = (rgba_color_t) {
+ red = 0, green = 0, blue = 1, alpha = 0.75
+ };
+ quad.corner_diameter = 20;
+ quad.down = false;
+ quad.active = -1;
+ quad.callback = callback;
+ quad.started = false;
+ }
+
+ protected *quad_t new (&nichrome_t nichrome, void(&quad_t) callback) {
+ quad_t quad;
+
+ init (&quad, &nichrome, callback);
+ return &quad;
+ }
+ }
+}
+import Nichrome;
+import Nichrome::Box;
+import Nichrome::Label;
+import Nichrome::Button;
+import Nichrome::Quad;
+
+import Cairo;
+typedef real[3,3] m_t;
+typedef point_t[4] q_t;
+
+/*
+ * Ok, given an source quad and a dest rectangle, compute
+ * a transform that maps the rectangle to q. That's easier
+ * as the rectangle has some nice simple properties. Invert
+ * the matrix to find the opposite mapping
+ *
+ * q0 q1
+ *
+ * q3 q2
+ *
+ * | m00 m01 m02 |
+ * | m10 m11 m12 |
+ * | m20 m21 m22 |
+ *
+ * m [ 0 0 1 ] = q[0]
+ *
+ * Set m22 to 1, and solve:
+ *
+ * | m02 , m12 , 1 | = | q0x, q0y, 1 |
+ *
+ * | m00 * w + q0x m10 * w + q0y |
+ * | ------------- , ------------- , 1 | = | q1x, q1y, 1 |
+ * | m20 * w + 1 m20 * w + 1 |
+
+ * m00*w + q0x = q1x*(m20*w + 1)
+ * m00 = m20*q1x + (q1x - q0x) / w;
+ *
+ * m10*w + q0y = q1y*(m20*w + 1)
+ * m10 = m20*q1y + (q1y - q0y) / w;
+ *
+ * m01*h + q0x = q3x*(m21*h + 1)
+ * m01 = m21*q3x + (q3x - q0x) / h;
+ *
+ * m11*h + q0y = q3y*(m21*h + 1)
+ * m11 = m21*q3y + (q3y - q0y) / h
+ *
+ * m00*w + m01*h + q0x = q2x*(m20*w + m21*h + 1)
+ *
+ * m20*q1x*w + q1x - q0x + m21*q3x*h + q3x - q0x + q0x = m20*q2x*w + m21*q2x*h + q2x
+ *
+ * m20*q1x*w - m20*q2x*w = m21*q2x*h - m21*q3x*h + q2x - q1x + q0x - q3x + q0x - q0x
+ *
+ * m20*(q1x - q2x)*w = m21*(q2x - q3x)*h + q2x - q1x - q3x + q0x
+ *
+ *
+ * m10*w + m11*h + q0y = q2y*(m20*w + m21*h + 1)
+ *
+ * m20*q1y*w + q1y - q0y + m21*q3y*h + q3y - q0y + q0y = m20*q2y*w + m21*q2y*h + q2y
+ *
+ * m20*q1y*w - m20*q2y*w = m21*q2y*h - m21*q3y*h + q2y - q1y + q0y - q3y + q0y - q0y
+ *
+ * m20*(q1y - q2y)*w = m21*(q2y - q3y)*h + q2y - q1y - q3y + q0y
+ *
+ *
+ * m20*(q1x - q2x)*(q1y - q2y)*w = m21*(q2x - q3x)*(q1y - q2y)*h + (q2x - q1x - q3x + q0x)*(q1y - q2y)
+ *
+ * m20*(q1y - q2y)*(q1x - q2x)*w = m21*(q2y - q3y)*(q1x - q2x)*h + (q2y - q1y - q3y + q0y)*(q1x - q2x)
+ *
+ * 0 = m21*((q2x - q3x)*(q1y - q2y) - (q2y - q3y)*(q1x - q2x))*h + (stuff)
+ * = m21 * a + b;
+ *
+ * m21 = -(stuff) / (other stuff)
+ *
+ * m20 = f(m21)
+ *
+ * m00 = f(m20)
+ * m10 = f(m20)
+ *
+ * m01 = f(m21)
+ * m11 = f(m21)
+ *
+ * done.
+ */
+m_t solve (q_t q, real w, real h)
+{
+ real q0x = q[0].x, q0y = q[0].y;
+ real q1x = q[1].x, q1y = q[1].y;
+ real q2x = q[2].x, q2y = q[2].y;
+ real q3x = q[3].x, q3y = q[3].y;
+ real m00, m01, m02;
+ real m10, m11, m12;
+ real m20, m21, m22;
+
+ m02 = q0x;
+ m12 = q0y;
+ m22 = 1;
+
+ real a = ((q2x - q3x)*(q1y - q2y) - (q2y - q3y)*(q1x - q2x)) * h;
+ real b = (q2x - q1x - q3x + q0x) * (q1y - q2y) - (q2y - q1y - q3y + q0y) * (q1x - q2x);
+ m21 = - b / a;
+
+ if (q1x != q2x)
+ m20 = (m21 * (q2x - q3x) * h + q2x - q1x - q3x + q0x) / ((q1x - q2x) * w);
+ else
+ m20 = (m21 * (q2y - q3y) * h + q2y - q1y - q3y + q0y) / ((q1y - q2y) * w);
+
+ m00 = m20 * q1x + (q1x - q0x) / w;
+ m10 = m20 * q1y + (q1y - q0y) / w;
+
+ m01 = m21 * q3x + (q3x - q0x) / h;
+ m11 = m21 * q3y + (q3y - q0y) / h;
+
+ return (m_t) {
+ { m00, m01, m02 },
+ { m10, m11, m12 },
+ { m20, m21, m22 } };
+}
+
+m_t
+invert (m_t m)
+{
+ real det;
+ int i, j;
+ m_t r;
+
+ static int[3] a = { 2, 2, 1 };
+ static int[3] b = { 1, 0, 0 };
+
+ det = 0;
+ for (i = 0; i < 3; i++) {
+ real p;
+ int ai = a[i];
+ int bi = b[i];
+ p = m[i,0] * (m[ai,2] * m[bi,1] - m[ai,1] * m[bi,2]);
+ if (i == 1)
+ p = -p;
+ det += p;
+ }
+ det = 1/det;
+ for (j = 0; j < 3; j++) {
+ for (i = 0; i < 3; i++) {
+ real p;
+ int ai = a[i];
+ int aj = a[j];
+ int bi = b[i];
+ int bj = b[j];
+
+ p = m[ai,aj] * m[bi,bj] - m[ai,bj] * m[bi,aj];
+ if (((i + j) & 1) != 0)
+ p = -p;
+ r[j,i] = det * p;
+ }
+ }
+ return r;
+}
+
+m_t
+rescale (m_t m, real limit)
+{
+ real max = 0;
+ for (int j = 0; j < 3; j++)
+ for (int i = 0; i < 3; i++)
+ if ((real v = abs (m[j,i])) > max)
+ max = v;
+ real scale = limit / max;
+ for (int j = 0; j < 3; j++)
+ for (int i = 0; i < 3; i++)
+ m[j,i] *= scale;
+ return m;
+
+}
+
+string
+m_print (m_t m)
+{
+ /*
+ return sprintf ("%.8f,%.8f,%.8f,%.8f,%.8f,%.8f,%.8f,%.8f,%.8f",
+ m[0,0],m[0,1],m[0,2],
+ m[1,0],m[1,1],m[1,2],
+ m[2,0],m[2,1],m[2,2]);
+ */
+ return sprintf ("%v,%v,%v,%v,%v,%v,%v,%v,%v",
+ m[0,0],m[0,1],m[0,2],
+ m[1,0],m[1,1],m[1,2],
+ m[2,0],m[2,1],m[2,2]);
+}
+
+int
+fixed (real x)
+{
+ return floor (x * 65536 + 0.5) & 0xffffffff;
+}
+
+void
+m_print_fix (m_t m)
+{
+ for (int i = 0; i < 3; i++)
+ {
+ printf (" { 0x%08x, 0x%08x, 0x%08x },\n",
+ fixed (m[i,0]), fixed (m[i,1]), fixed (m[i,2]));
+ }
+}
+
+string
+m_row (m_t m, int row)
+{
+ return sprintf ("%10.5f %10.5f %10.5f",
+ m[row,0],m[row,1],m[row,2]);
+}
+
+Cairo::point_t[*] scale(Cairo::point_t[*] p, real w, real h)
+{
+ for (int i = 0; i < dim (p); i++) {
+ p[i].x *= w;
+ p[i].y *= h;
+ }
+ return p;
+}
+
+typedef struct {
+ string name;
+ rect_t geometry;
+} output_t;
+
+autoload Process;
+
+
+output_t[*] get_outputs () {
+ output_t[...] outputs = {};
+ twixt (file randr = Process::popen (Process::popen_direction.read,
+ false, "xrandr", "xrandr");
+ File::close (randr))
+ {
+ while (!File::end (randr)) {
+ string[*] words = String::wordsplit (File::fgets (randr), " ");
+ if (dim (words) >= 3 && words[1] == "connected" &&
+ File::sscanf (words[2], "%dx%d+%d+%d",
+ &(int width), &(int height),
+ &(int x), &(int y)) == 4)
+ {
+ outputs[dim(outputs)] = (output_t) {
+ name = words[0],
+ geometry = {
+ x = x, y = y, width = width, height = height
+ }
+ };
+ }
+ }
+ }
+ return outputs;
+}
+
+void main ()
+{
+ m_t m = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } }, m_i, m_r;
+ bool m_available = true;
+ output_t[*] outputs = get_outputs ();
+ output_t target_output;
+
+ if (dim (outputs) == 0) {
+ File::fprintf (stderr, "%s: No enabled outputs\n", argv[0]);
+ exit (1);
+ }
+
+ if (dim (argv) > 1) {
+ int i;
+ for (i = 0; i < dim (outputs); i++)
+ if (argv[1] == outputs[i].name) {
+ target_output = outputs[i];
+ break;
+ }
+ if (i == dim (outputs)) {
+ File::fprintf (stderr, "%s: no enabled output \"%s\"\n",
+ argv[0], argv[1]);
+ exit (1);
+ }
+ }
+ else
+ target_output = outputs[0];
+
+ real target_width = target_output.geometry.width;
+ real target_height = target_output.geometry.height;
+
+ real screen_width = 0;
+ real screen_height = 0;
+
+ for (int i = 0; i < dim (outputs); i++)
+ {
+ screen_width = max (screen_width,
+ outputs[i].geometry.x +
+ outputs[i].geometry.width);
+ screen_height = max (screen_height,
+ outputs[i].geometry.y +
+ outputs[i].geometry.height);
+ }
+
+ &nichrome_t nichrome = Nichrome::new ("Keystone Correction", 400, 350);
+
+ (*label_t)[3] label;
+ &label_t space = Label::new (&nichrome, "");
+ for (int i = 0; i < 3; i++) {
+ label[i] = Label::new (&nichrome, "matrix");
+ label[i]->font = "sans-9";
+ }
+
+ void callback (&quad_t quad) {
+ real w = quad.geometry.width;
+ real h = quad.geometry.height;
+ string[3] text;
+ try {
+ m = solve (scale (quad.p, target_width / w, target_height / h),
+ target_width, target_height);
+ m_i = invert (m);
+ m_r = rescale (m_i, 16384);
+ for (int i = 0; i < 3; i++)
+ text[i] = m_row (m_i,i);
+ m_available = true;
+ } catch divide_by_zero (real a, real b) {
+ text = (string[3]) { "no solution", "" ... };
+ m_available = false;
+ }
+ for (int i = 0; i < 3; i++)
+ Label::relabel (label[i], text[i]);
+ }
+ &quad_t quad = Quad::new (&nichrome, callback);
+
+ void doit_func (&widget_t widget, bool state)
+ {
+ if (m_available)
+ {
+ Process::system ("xrandr",
+ "xrandr",
+ "--fb",
+ sprintf ("%dx%d", screen_width, screen_height),
+ "--output",
+ target_output.name,
+ "--transform",
+ m_print (m_r));
+ }
+ }
+
+ &button_t doit = Button::new (&nichrome, "doit", doit_func);
+
+ void show_func (&widget_t widget, bool state)
+ {
+ if (m_available)
+ {
+ printf ("normal: %s\n", m_print (m));
+ printf ("inverse: %s\n", m_print (m_i));
+ printf ("scaled: %s\n", m_print (m_r));
+ printf ("fixed:\n");
+ m_print_fix (m_i);
+ }
+ }
+
+ &button_t show = Button::new (&nichrome, "show", show_func);
+ &button_t quit = Button::new (&nichrome, "quit",
+ void func (&widget_t w, bool state) {
+ w.nichrome.running = false;
+ });
+
+ &box_t hbox = Box::new (Box::dir_t.horizontal,
+ Box::widget_item (&doit, 0),
+ Box::widget_item (&show, 0),
+
+ Box::widget_item (&quit, 0),
+ Box::glue_item (1));
+ &box_t box = Box::new (Box::dir_t.vertical,
+ Box::box_item (&hbox),
+ Box::widget_item (label[0], 0),
+ Box::widget_item (label[1], 0),
+ Box::widget_item (label[2], 0),
+ Box::widget_item (&space, 0),
+ Box::widget_item (&quad, 1));
+ Nichrome::set_box (&nichrome, &box);
+ Nichrome::main_loop (&nichrome);
+}
+
+main ();
diff --git a/app/xrandr/xrandr.c b/app/xrandr/xrandr.c
index e2a657f65..0f5ab945d 100644
--- a/app/xrandr/xrandr.c
+++ b/app/xrandr/xrandr.c
@@ -48,6 +48,8 @@ static int screen = -1;
static Bool verbose = False;
static Bool automatic = False;
static Bool properties = False;
+static Bool grab_server = True;
+static Bool no_primary = False;
static char *direction[5] = {
"normal",
@@ -106,6 +108,7 @@ usage(void)
fprintf(stderr, " --screen <screen>\n");
fprintf(stderr, " --verbose\n");
fprintf(stderr, " --dryrun\n");
+ fprintf(stderr, " --nograb\n");
#if HAS_RANDR_1_2
fprintf(stderr, " --prop or --properties\n");
fprintf(stderr, " --fb <width>x<height>\n");
@@ -129,8 +132,14 @@ usage(void)
fprintf(stderr, " --below <output>\n");
fprintf(stderr, " --same-as <output>\n");
fprintf(stderr, " --set <property> <value>\n");
+ fprintf(stderr, " --scale <x>x<y>\n");
+ fprintf(stderr, " --transform <a>,<b>,<c>,<d>,<e>,<f>,<g>,<h>,<i>\n");
fprintf(stderr, " --off\n");
fprintf(stderr, " --crtc <crtc>\n");
+ fprintf(stderr, " --panning <w>x<h>[+<x>+<y>[/<track:w>x<h>+<x>+<y>[/<border:l>/<t>/<r>/<b>]]]\n");
+ fprintf(stderr, " --gamma <r>:<g>:<b>\n");
+ fprintf(stderr, " --primary\n");
+ fprintf(stderr, " --noprimary\n");
fprintf(stderr, " --newmode <name> <clock MHz>\n");
fprintf(stderr, " <hdisp> <hsync-start> <hsync-end> <htotal>\n");
fprintf(stderr, " <vdisp> <vsync-start> <vsync-end> <vtotal>\n");
@@ -157,6 +166,17 @@ fatal (const char *format, ...)
/*NOTREACHED*/
}
+static void
+warning (const char *format, ...)
+{
+ va_list ap;
+
+ va_start (ap, format);
+ fprintf (stderr, "%s: ", program_name);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
+}
+
static char *
rotation_name (Rotation rotation)
{
@@ -196,6 +216,18 @@ typedef enum _relation {
left_of, right_of, above, below, same_as,
} relation_t;
+typedef struct {
+ int x, y, width, height;
+} rectangle_t;
+
+typedef struct {
+ int x1, y1, x2, y2;
+} box_t;
+
+typedef struct {
+ int x, y;
+} point_t;
+
typedef enum _changes {
changes_none = 0,
changes_crtc = (1 << 0),
@@ -207,6 +239,10 @@ typedef enum _changes {
changes_automatic = (1 << 6),
changes_refresh = (1 << 7),
changes_property = (1 << 8),
+ changes_transform = (1 << 9),
+ changes_panning = (1 << 10),
+ changes_gamma = (1 << 11),
+ changes_primary = (1 << 12),
} changes_t;
typedef enum _name_kind {
@@ -226,20 +262,30 @@ typedef struct {
typedef struct _crtc crtc_t;
typedef struct _output output_t;
+typedef struct _transform transform_t;
typedef struct _umode umode_t;
typedef struct _output_prop output_prop_t;
+struct _transform {
+ XTransform transform;
+ char *filter;
+ int nparams;
+ XFixed *params;
+};
+
struct _crtc {
name_t crtc;
Bool changing;
XRRCrtcInfo *crtc_info;
XRRModeInfo *mode_info;
+ XRRPanning *panning_info;
int x;
int y;
Rotation rotation;
output_t **outputs;
int noutput;
+ transform_t current_transform, pending_transform;
};
struct _output_prop {
@@ -273,8 +319,19 @@ struct _output {
int x, y;
Rotation rotation;
-
+
+ XRRPanning panning;
+
Bool automatic;
+ transform_t transform;
+
+ struct {
+ float red;
+ float green;
+ float blue;
+ } gamma;
+
+ Bool primary;
};
typedef enum _umode_action {
@@ -322,6 +379,7 @@ static char *dpi_output = NULL;
static Bool dryrun = False;
static int minWidth, maxWidth, minHeight, maxHeight;
static Bool has_1_2 = False;
+static Bool has_1_3 = False;
static int
mode_height (XRRModeInfo *mode_info, Rotation rotation)
@@ -353,6 +411,81 @@ mode_width (XRRModeInfo *mode_info, Rotation rotation)
}
}
+static Bool
+transform_point (XTransform *transform, double *xp, double *yp)
+{
+ double vector[3];
+ double result[3];
+ int i, j;
+ double v;
+
+ vector[0] = *xp;
+ vector[1] = *yp;
+ vector[2] = 1;
+ for (j = 0; j < 3; j++)
+ {
+ v = 0;
+ for (i = 0; i < 3; i++)
+ v += (XFixedToDouble (transform->matrix[j][i]) * vector[i]);
+ if (v > 32767 || v < -32767)
+ return False;
+ result[j] = v;
+ }
+ if (!result[2])
+ return False;
+ for (j = 0; j < 2; j++)
+ vector[j] = result[j] / result[2];
+ *xp = vector[0];
+ *yp = vector[1];
+ return True;
+}
+
+static void
+path_bounds (XTransform *transform, point_t *points, int npoints, box_t *box)
+{
+ int i;
+ box_t point;
+
+ for (i = 0; i < npoints; i++) {
+ double x, y;
+ x = points[i].x;
+ y = points[i].y;
+ transform_point (transform, &x, &y);
+ point.x1 = floor (x);
+ point.y1 = floor (y);
+ point.x2 = ceil (x);
+ point.y2 = ceil (y);
+ if (i == 0)
+ *box = point;
+ else {
+ if (point.x1 < box->x1) box->x1 = point.x1;
+ if (point.y1 < box->y1) box->y1 = point.y1;
+ if (point.x2 > box->x2) box->x2 = point.x2;
+ if (point.y2 > box->y2) box->y2 = point.y2;
+ }
+ }
+}
+
+static void
+mode_geometry (XRRModeInfo *mode_info, Rotation rotation,
+ XTransform *transform,
+ box_t *bounds)
+{
+ point_t rect[4];
+ int width = mode_width (mode_info, rotation);
+ int height = mode_height (mode_info, rotation);
+
+ rect[0].x = 0;
+ rect[0].y = 0;
+ rect[1].x = width;
+ rect[1].y = 0;
+ rect[2].x = width;
+ rect[2].y = height;
+ rect[3].x = 0;
+ rect[3].y = height;
+ path_bounds (transform, rect, 4, bounds);
+}
+
/* v refresh frequency in Hz */
static float
mode_refresh (XRRModeInfo *mode_info)
@@ -428,7 +561,8 @@ set_name_all (name_t *name, name_t *old)
static void
set_name (name_t *name, char *string, name_kind_t valid)
{
- XID xid;
+ unsigned int xid; /* don't make it XID (which is unsigned long):
+ scanf() takes unsigned int */
int index;
if ((valid & name_xid) && sscanf (string, "0x%x", &xid) == 1)
@@ -441,13 +575,60 @@ set_name (name_t *name, char *string, name_kind_t valid)
usage ();
}
+static void
+init_transform (transform_t *transform)
+{
+ int x;
+ memset (&transform->transform, '\0', sizeof (transform->transform));
+ for (x = 0; x < 3; x++)
+ transform->transform.matrix[x][x] = XDoubleToFixed (1.0);
+ transform->filter = "";
+ transform->nparams = 0;
+ transform->params = NULL;
+}
+
+static void
+set_transform (transform_t *dest,
+ XTransform *transform,
+ char *filter,
+ XFixed *params,
+ int nparams)
+{
+ dest->transform = *transform;
+ dest->filter = strdup (filter);
+ dest->nparams = nparams;
+ dest->params = malloc (nparams * sizeof (XFixed));
+ memcpy (dest->params, params, nparams * sizeof (XFixed));
+}
+
+static void
+copy_transform (transform_t *dest, transform_t *src)
+{
+ set_transform (dest, &src->transform,
+ src->filter, src->params, src->nparams);
+}
+
+static Bool
+equal_transform (transform_t *a, transform_t *b)
+{
+ if (memcmp (&a->transform, &b->transform, sizeof (XTransform)) != 0)
+ return False;
+ if (strcmp (a->filter, b->filter) != 0)
+ return False;
+ if (a->nparams != b->nparams)
+ return False;
+ if (memcmp (a->params, b->params, a->nparams * sizeof (XFixed)) != 0)
+ return False;
+ return True;
+}
+
static output_t *
add_output (void)
{
output_t *output = calloc (1, sizeof (output_t));
if (!output)
- fatal ("out of memory");
+ fatal ("out of memory\n");
output->next = NULL;
*outputs_tail = output;
outputs_tail = &output->next;
@@ -571,6 +752,7 @@ find_mode_by_xid (RRMode mode)
return find_mode (&mode_name, 0);
}
+#if 0
static XRRModeInfo *
find_mode_by_name (char *name)
{
@@ -579,6 +761,7 @@ find_mode_by_name (char *name)
set_name_string (&mode_name, name);
return find_mode (&mode_name, 0);
}
+#endif
static
XRRModeInfo *
@@ -592,7 +775,7 @@ find_mode_for_output (output_t *output, name_t *name)
for (m = 0; m < output_info->nmode; m++)
{
XRRModeInfo *mode;
-
+
mode = find_mode_by_xid (output_info->modes[m]);
if (!mode) continue;
if ((name->kind & name_xid) && name->xid == mode->id)
@@ -603,7 +786,11 @@ find_mode_for_output (output_t *output, name_t *name)
if ((name->kind & name_string) && !strcmp (name->string, mode->name))
{
float dist;
-
+
+ /* Stay away from doublescan modes unless refresh rate is specified. */
+ if (!output->refresh && (mode->modeFlags & RR_DoubleScan))
+ continue;
+
if (output->refresh)
dist = fabs (mode_refresh (mode) - output->refresh);
else
@@ -618,7 +805,7 @@ find_mode_for_output (output_t *output, name_t *name)
return best;
}
-XRRModeInfo *
+static XRRModeInfo *
preferred_mode (output_t *output)
{
XRROutputInfo *output_info = output->output_info;
@@ -686,6 +873,19 @@ crtc_can_use_rotation (crtc_t *crtc, Rotation rotation)
return False;
}
+#if 0
+static Bool
+crtc_can_use_transform (crtc_t *crtc, XTransform *transform)
+{
+ int major, minor;
+
+ XRRQueryVersion (dpy, &major, &minor);
+ if (major > 1 || (major == 1 && minor >= 3))
+ return True;
+ return False;
+}
+#endif
+
/*
* Report only rotations that are supported by all crtcs
*/
@@ -732,13 +932,21 @@ output_can_use_rotation (output_t *output, Rotation rotation)
return True;
}
+static Bool
+output_is_primary(output_t *output)
+{
+ if (has_1_3)
+ return XRRGetOutputPrimary(dpy, root) == output->output.xid;
+ return False;
+}
+
static void
set_output_info (output_t *output, RROutput xid, XRROutputInfo *output_info)
{
/* sanity check output info */
if (output_info->connection != RR_Disconnected && !output_info->nmode)
- fatal ("Output %s is not disconnected but has no modes\n",
- output_info->name);
+ warning ("Output %s is not disconnected but has no modes\n",
+ output_info->name);
/* set output name and info */
if (!(output->output.kind & name_xid))
@@ -843,10 +1051,23 @@ set_output_info (output_t *output, RROutput xid, XRROutputInfo *output_info)
output->output.string,
rotation_name (output->rotation),
reflection_name (output->rotation));
+
+ /* set transformation */
+ if (!(output->changes & changes_transform))
+ {
+ if (output->crtc_info)
+ copy_transform (&output->transform, &output->crtc_info->current_transform);
+ else
+ init_transform (&output->transform);
+ }
+
+ /* set primary */
+ if (!(output->changes & changes_primary))
+ output->primary = output_is_primary(output);
}
static void
-get_screen (void)
+get_screen (Bool current)
{
if (!has_1_2)
fatal ("Server RandR version before 1.2\n");
@@ -854,7 +1075,10 @@ get_screen (void)
XRRGetScreenSizeRange (dpy, root, &minWidth, &minHeight,
&maxWidth, &maxHeight);
- res = XRRGetScreenResources (dpy, root);
+ if (current)
+ res = XRRGetScreenResourcesCurrent (dpy, root);
+ else
+ res = XRRGetScreenResources (dpy, root);
if (!res) fatal ("could not get screen resources");
}
@@ -865,15 +1089,32 @@ get_crtcs (void)
num_crtcs = res->ncrtc;
crtcs = calloc (num_crtcs, sizeof (crtc_t));
- if (!crtcs) fatal ("out of memory");
+ if (!crtcs) fatal ("out of memory\n");
for (c = 0; c < res->ncrtc; c++)
{
XRRCrtcInfo *crtc_info = XRRGetCrtcInfo (dpy, res, res->crtcs[c]);
+#if RANDR_MAJOR > 1 || RANDR_MINOR >= 3
+ XRRCrtcTransformAttributes *attr;
+#endif
+ XRRPanning *panning_info = NULL;
+
+ if (has_1_3) {
+ XRRPanning zero;
+ memset(&zero, 0, sizeof(zero));
+ panning_info = XRRGetPanning (dpy, res, res->crtcs[c]);
+ zero.timestamp = panning_info->timestamp;
+ if (!memcmp(panning_info, &zero, sizeof(zero))) {
+ Xfree(panning_info);
+ panning_info = NULL;
+ }
+ }
+
set_name_xid (&crtcs[c].crtc, res->crtcs[c]);
set_name_index (&crtcs[c].crtc, c);
- if (!crtc_info) fatal ("could not get crtc 0x%x information", res->crtcs[c]);
+ if (!crtc_info) fatal ("could not get crtc 0x%x information\n", res->crtcs[c]);
crtcs[c].crtc_info = crtc_info;
+ crtcs[c].panning_info = panning_info;
if (crtc_info->mode == None)
{
crtcs[c].mode_info = NULL;
@@ -881,7 +1122,22 @@ get_crtcs (void)
crtcs[c].y = 0;
crtcs[c].rotation = RR_Rotate_0;
}
- }
+#if RANDR_MAJOR > 1 || RANDR_MINOR >= 3
+ if (XRRGetCrtcTransform (dpy, res->crtcs[c], &attr) && attr) {
+ set_transform (&crtcs[c].current_transform,
+ &attr->currentTransform,
+ attr->currentFilter,
+ attr->currentParams,
+ attr->currentNparams);
+ XFree (attr);
+ }
+ else
+#endif
+ {
+ init_transform (&crtcs[c].current_transform);
+ }
+ copy_transform (&crtcs[c].pending_transform, &crtcs[c].current_transform);
+ }
}
static void
@@ -896,8 +1152,9 @@ crtc_add_output (crtc_t *crtc, output_t *output)
crtc->y = output->y;
crtc->rotation = output->rotation;
crtc->mode_info = output->mode_info;
- }
- if (!crtc->outputs) fatal ("out of memory");
+ copy_transform (&crtc->pending_transform, &output->transform);
+ }
+ if (!crtc->outputs) fatal ("out of memory\n");
crtc->outputs[crtc->noutput++] = output;
}
@@ -913,6 +1170,100 @@ set_crtcs (void)
}
}
+static void
+set_panning (void)
+{
+ output_t *output;
+
+ for (output = outputs; output; output = output->next)
+ {
+ if (! output->crtc_info)
+ continue;
+ if (! (output->changes & changes_panning))
+ continue;
+ if (! output->crtc_info->panning_info)
+ output->crtc_info->panning_info = malloc (sizeof(XRRPanning));
+ memcpy (output->crtc_info->panning_info, &output->panning, sizeof(XRRPanning));
+ output->crtc_info->changing = 1;
+ }
+}
+
+static void
+set_gamma(void)
+{
+ output_t *output;
+
+ for (output = outputs; output; output = output->next) {
+ int i, size;
+ crtc_t *crtc;
+ XRRCrtcGamma *gamma;
+
+ if (!(output->changes & changes_gamma))
+ continue;
+
+ if (!output->crtc_info) {
+ fatal("Need crtc to set gamma on.\n");
+ continue;
+ }
+
+ crtc = output->crtc_info;
+
+ size = XRRGetCrtcGammaSize(dpy, crtc->crtc.xid);
+
+ if (!size) {
+ fatal("Gamma size is 0.\n");
+ continue;
+ }
+
+ gamma = XRRAllocGamma(size);
+ if (!gamma) {
+ fatal("Gamma allocation failed.\n");
+ continue;
+ }
+
+ for (i = 0; i < size; i++) {
+ if (output->gamma.red == 1.0)
+ gamma->red[i] = i << 8;
+ else
+ gamma->red[i] = (CARD16)(pow((double)i/(double)(size - 1),
+ (double)output->gamma.red) * (double)(size - 1) * 256);
+
+ if (output->gamma.green == 1.0)
+ gamma->green[i] = i << 8;
+ else
+ gamma->green[i] = (CARD16)(pow((double)i/(double)(size - 1),
+ (double)output->gamma.green) * (double)(size - 1) * 256);
+
+ if (output->gamma.blue == 1.0)
+ gamma->blue[i] = i << 8;
+ else
+ gamma->blue[i] = (CARD16)(pow((double)i/(double)(size - 1),
+ (double)output->gamma.blue) * (double)(size - 1) * 256);
+ }
+
+ XRRSetCrtcGamma(dpy, crtc->crtc.xid, gamma);
+
+ free(gamma);
+ }
+}
+
+static void
+set_primary(void)
+{
+ output_t *output;
+
+ if (no_primary) {
+ XRRSetOutputPrimary(dpy, root, None);
+ } else {
+ for (output = outputs; output; output = output->next) {
+ if (!(output->changes & changes_primary))
+ continue;
+ if (output->primary)
+ XRRSetOutputPrimary(dpy, root, output->output.xid);
+ }
+ }
+}
+
static Status
crtc_disable (crtc_t *crtc)
{
@@ -925,6 +1276,20 @@ crtc_disable (crtc_t *crtc)
0, 0, None, RR_Rotate_0, NULL, 0);
}
+static void
+crtc_set_transform (crtc_t *crtc, transform_t *transform)
+{
+ int major, minor;
+
+ XRRQueryVersion (dpy, &major, &minor);
+ if (major > 1 || (major == 1 && minor >= 3))
+ XRRSetCrtcTransform (dpy, crtc->crtc.xid,
+ &transform->transform,
+ transform->filter,
+ transform->params,
+ transform->nparams);
+}
+
static Status
crtc_revert (crtc_t *crtc)
{
@@ -935,6 +1300,9 @@ crtc_revert (crtc_t *crtc)
if (dryrun)
return RRSetConfigSuccess;
+
+ if (!equal_transform (&crtc->current_transform, &crtc->pending_transform))
+ crtc_set_transform (crtc, &crtc->current_transform);
return XRRSetCrtcConfig (dpy, res, crtc->crtc.xid, CurrentTime,
crtc_info->x, crtc_info->y,
crtc_info->mode, crtc_info->rotation,
@@ -970,9 +1338,19 @@ crtc_apply (crtc_t *crtc)
if (dryrun)
s = RRSetConfigSuccess;
else
+ {
+ if (!equal_transform (&crtc->current_transform, &crtc->pending_transform))
+ crtc_set_transform (crtc, &crtc->pending_transform);
s = XRRSetCrtcConfig (dpy, res, crtc->crtc.xid, CurrentTime,
crtc->x, crtc->y, mode, crtc->rotation,
rr_outputs, crtc->noutput);
+ if (s == RRSetConfigSuccess && crtc->panning_info) {
+ if (has_1_3)
+ s = XRRSetPanning (dpy, res, crtc->crtc.xid, crtc->panning_info);
+ else
+ fatal ("panning needs RandR 1.3\n");
+ }
+ }
free (rr_outputs);
return s;
}
@@ -1051,7 +1429,7 @@ panic (Status s, crtc_t *crtc)
exit (1);
}
-void
+static void
apply (void)
{
Status s;
@@ -1078,16 +1456,21 @@ apply (void)
{
XRRModeInfo *old_mode = find_mode_by_xid (crtc_info->mode);
int x, y, w, h;
+ box_t bounds;
if (!old_mode)
panic (RRSetConfigFailed, crtc);
/* old position and size information */
- x = crtc_info->x;
- y = crtc_info->y;
- w = mode_width (old_mode, crtc_info->rotation);
- h = mode_height (old_mode, crtc_info->rotation);
-
+ mode_geometry (old_mode, crtc_info->rotation,
+ &crtc->current_transform.transform,
+ &bounds);
+
+ x = crtc_info->x + bounds.x1;
+ y = crtc_info->y + bounds.y1;
+ w = bounds.x2 - bounds.x1;
+ h = bounds.y2 - bounds.y1;
+
/* if it fits, skip it */
if (x + w <= fb_width && y + h <= fb_height)
continue;
@@ -1104,7 +1487,8 @@ apply (void)
* event and ask for xinerama information from the server
* receive up-to-date information
*/
- XGrabServer (dpy);
+ if (grab_server)
+ XGrabServer (dpy);
/*
* Set the screen size
@@ -1123,17 +1507,21 @@ apply (void)
if (s != RRSetConfigSuccess)
panic (s, crtc);
}
+
+ set_primary ();
+
/*
* Release the server grab and let all clients
* respond to the updated state
*/
- XUngrabServer (dpy);
+ if (grab_server)
+ XUngrabServer (dpy);
}
/*
* Use current output state to complete the output list
*/
-void
+static void
get_outputs (void)
{
int o;
@@ -1143,7 +1531,7 @@ get_outputs (void)
XRROutputInfo *output_info = XRRGetOutputInfo (dpy, res, res->outputs[o]);
output_t *output;
name_t output_name;
- if (!output_info) fatal ("could not get output 0x%x information", res->outputs[o]);
+ if (!output_info) fatal ("could not get output 0x%x information\n", res->outputs[o]);
set_name_xid (&output_name, res->outputs[o]);
set_name_index (&output_name, o);
set_name_string (&output_name, output_info->name);
@@ -1207,7 +1595,7 @@ get_outputs (void)
}
}
-void
+static void
mark_changing_crtcs (void)
{
int c;
@@ -1283,6 +1671,8 @@ check_crtc_for_output (crtc_t *crtc, output_t *output)
return False;
if (crtc->rotation != output->rotation)
return False;
+ if (!equal_transform (&crtc->current_transform, &output->transform))
+ return False;
}
else if (crtc->crtc_info->noutput)
{
@@ -1301,7 +1691,7 @@ check_crtc_for_output (crtc_t *crtc, output_t *output)
return True;
}
-crtc_t *
+static crtc_t *
find_crtc_for_output (output_t *output)
{
int c;
@@ -1429,25 +1819,40 @@ set_screen_size (void)
{
XRRModeInfo *mode_info = output->mode_info;
int x, y, w, h;
+ box_t bounds;
if (!mode_info) continue;
- x = output->x;
- y = output->y;
- w = mode_width (mode_info, output->rotation);
- h = mode_height (mode_info, output->rotation);
+ mode_geometry (mode_info, output->rotation,
+ &output->transform.transform,
+ &bounds);
+ x = output->x + bounds.x1;
+ y = output->y + bounds.y1;
+ w = bounds.x2 - bounds.x1;
+ h = bounds.y2 - bounds.y1;
/* make sure output fits in specified size */
if (fb_specified)
{
if (x + w > fb_width || y + h > fb_height)
- fatal ("specified screen %dx%d not large enough for output %s (%dx%d+%d+%d)\n",
- fb_width, fb_height, output->output.string, w, h, x, y);
+ warning ("specified screen %dx%d not large enough for output %s (%dx%d+%d+%d)\n",
+ fb_width, fb_height, output->output.string, w, h, x, y);
}
/* fit fb to output */
else
{
- if (x + w > fb_width) fb_width = x + w;
- if (y + h > fb_height) fb_height = y + h;
+ XRRPanning *pan;
+ if (x + w > fb_width)
+ fb_width = x + w;
+ if (y + h > fb_height)
+ fb_height = y + h;
+ if (output->changes & changes_panning)
+ pan = &output->panning;
+ else
+ pan = output->crtc_info ? output->crtc_info->panning_info : NULL;
+ if (pan && pan->left + pan->width > fb_width)
+ fb_width = pan->left + pan->width;
+ if (pan && pan->top + pan->height > fb_height)
+ fb_height = pan->top + pan->height;
}
}
@@ -1467,8 +1872,8 @@ set_screen_size (void)
}
#endif
-
-void
+
+static void
disable_outputs (output_t *outputs)
{
while (outputs)
@@ -1481,7 +1886,7 @@ disable_outputs (output_t *outputs)
/*
* find the best mapping from output to crtc available
*/
-int
+static int
pick_crtcs_score (output_t *outputs)
{
output_t *output;
@@ -1547,7 +1952,7 @@ pick_crtcs_score (output_t *outputs)
/*
* Pick crtcs for any changing outputs that don't have one
*/
-void
+static void
pick_crtcs (void)
{
output_t *output;
@@ -1629,6 +2034,7 @@ main (int argc, char **argv)
Bool propit = False;
Bool query_1 = False;
int major, minor;
+ Bool current = False;
#endif
program_name = argv[0];
@@ -1652,6 +2058,16 @@ main (int argc, char **argv)
verbose = True;
continue;
}
+ if (!strcmp ("--nograb", argv[i])) {
+ grab_server = False;
+ continue;
+ }
+ if (!strcmp("--current", argv[i])) {
+ current = True;
+ /* if --current was the only arg, then query */
+ if (argc == 2) query = True;
+ continue;
+ }
if (!strcmp ("-s", argv[i]) || !strcmp ("--size", argv[i])) {
if (++i>=argc) usage ();
@@ -1724,7 +2140,10 @@ main (int argc, char **argv)
continue;
}
#if HAS_RANDR_1_2
- if (!strcmp ("--prop", argv[i]) || !strcmp ("--properties", argv[i]))
+ if (!strcmp ("--prop", argv[i]) ||
+ !strcmp ("--props", argv[i]) ||
+ !strcmp ("--madprops", argv[i]) ||
+ !strcmp ("--properties", argv[i]))
{
query_1_2 = True;
properties = True;
@@ -1837,6 +2256,58 @@ main (int argc, char **argv)
output->changes |= changes_relation;
continue;
}
+ if (!strcmp ("--panning", argv[i])) {
+ XRRPanning *pan;
+ if (++i>=argc) usage ();
+ if (!output) usage();
+ pan = &output->panning;
+ switch (sscanf (argv[i], "%dx%d+%d+%d/%dx%d+%d+%d/%d/%d/%d/%d",
+ &pan->width, &pan->height, &pan->left, &pan->top,
+ &pan->track_width, &pan->track_height,
+ &pan->track_left, &pan->track_top,
+ &pan->border_left, &pan->border_top,
+ &pan->border_right, &pan->border_bottom)) {
+ case 2:
+ pan->left = pan->top = 0;
+ /* fall through */
+ case 4:
+ pan->track_left = pan->track_top =
+ pan->track_width = pan->track_height = 0;
+ /* fall through */
+ case 8:
+ pan->border_left = pan->border_top =
+ pan->border_right = pan->border_bottom = 0;
+ /* fall through */
+ case 12:
+ break;
+ default:
+ usage ();
+ }
+ output->changes |= changes_panning;
+ continue;
+ }
+ if (!strcmp ("--gamma", argv[i])) {
+ if (!output) usage();
+ if (++i>=argc) usage ();
+ if (sscanf(argv[i], "%f:%f:%f", &output->gamma.red,
+ &output->gamma.green, &output->gamma.blue) != 3)
+ usage ();
+ output->changes |= changes_gamma;
+ setit_1_2 = True;
+ continue;
+ }
+ if (!strcmp ("--primary", argv[i])) {
+ if (!output) usage();
+ output->changes |= changes_primary;
+ output->primary = True;
+ setit_1_2 = True;
+ continue;
+ }
+ if (!strcmp ("--noprimary", argv[i])) {
+ no_primary = True;
+ setit_1_2 = True;
+ continue;
+ }
if (!strcmp ("--set", argv[i])) {
output_prop_t *prop;
if (!output) usage();
@@ -1852,6 +2323,50 @@ main (int argc, char **argv)
setit_1_2 = True;
continue;
}
+ if (!strcmp ("--scale", argv[i]))
+ {
+ double sx, sy;
+ if (++i>=argc) usage();
+ if (sscanf (argv[i], "%lfx%lf", &sx, &sy) != 2)
+ usage ();
+ init_transform (&output->transform);
+ output->transform.transform.matrix[0][0] = XDoubleToFixed (sx);
+ output->transform.transform.matrix[1][1] = XDoubleToFixed (sy);
+ output->transform.transform.matrix[2][2] = XDoubleToFixed (1.0);
+ if (sx != 1 || sy != 1)
+ output->transform.filter = "bilinear";
+ else
+ output->transform.filter = "nearest";
+ output->transform.nparams = 0;
+ output->transform.params = NULL;
+ output->changes |= changes_transform;
+ continue;
+ }
+ if (!strcmp ("--transform", argv[i])) {
+ double transform[3][3];
+ int k, l;
+ if (++i>=argc) usage ();
+ init_transform (&output->transform);
+ if (strcmp (argv[i], "none") != 0)
+ {
+ if (sscanf(argv[i], "%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",
+ &transform[0][0],&transform[0][1],&transform[0][2],
+ &transform[1][0],&transform[1][1],&transform[1][2],
+ &transform[2][0],&transform[2][1],&transform[2][2])
+ != 9)
+ usage ();
+ init_transform (&output->transform);
+ for (k = 0; k < 3; k++)
+ for (l = 0; l < 3; l++) {
+ output->transform.transform.matrix[k][l] = XDoubleToFixed (transform[k][l]);
+ }
+ output->transform.filter = "bilinear";
+ output->transform.nparams = 0;
+ output->transform.params = NULL;
+ }
+ output->changes |= changes_transform;
+ continue;
+ }
if (!strcmp ("--off", argv[i])) {
if (!output) usage();
set_name_xid (&output->mode, None);
@@ -2031,12 +2546,14 @@ main (int argc, char **argv)
}
if (major > 1 || (major == 1 && minor >= 2))
has_1_2 = True;
+ if (major > 1 || (major == 1 && minor >= 3))
+ has_1_3 = True;
if (has_1_2 && modeit)
{
umode_t *m;
- get_screen ();
+ get_screen (current);
get_crtcs();
get_outputs();
@@ -2084,7 +2601,7 @@ main (int argc, char **argv)
if (has_1_2 && propit)
{
- get_screen ();
+ get_screen (current);
get_crtcs();
get_outputs();
@@ -2147,6 +2664,8 @@ main (int argc, char **argv)
nelements = strlen (prop->value);
format = 8;
}
+ else
+ continue;
XRRChangeOutputProperty (dpy, output->output.xid,
name, type, format, PropModeReplace,
data, nelements);
@@ -2160,7 +2679,7 @@ main (int argc, char **argv)
}
if (setit_1_2)
{
- get_screen ();
+ get_screen (current);
get_crtcs ();
get_outputs ();
set_positions ();
@@ -2231,6 +2750,16 @@ main (int argc, char **argv)
}
/*
+ * Set panning
+ */
+ set_panning ();
+
+ /*
+ * Set gamma on crtc's that belong to the outputs.
+ */
+ set_gamma ();
+
+ /*
* Now apply all of the changes
*/
apply ();
@@ -2245,7 +2774,7 @@ main (int argc, char **argv)
#define ModeShown 0x80000000
- get_screen ();
+ get_screen (current);
get_crtcs ();
get_outputs ();
@@ -2257,6 +2786,8 @@ main (int argc, char **argv)
for (output = outputs; output; output = output->next)
{
XRROutputInfo *output_info = output->output_info;
+ crtc_t *crtc = output->crtc_info;
+ XRRCrtcInfo *crtc_info = crtc ? crtc->crtc_info : NULL;
XRRModeInfo *mode = output->mode_info;
Atom *props;
int j, k, nprop;
@@ -2266,12 +2797,16 @@ main (int argc, char **argv)
printf ("%s %s", output_info->name, connection[output_info->connection]);
if (mode)
{
- printf (" %dx%d+%d+%d",
- mode_width (mode, output->rotation),
- mode_height (mode, output->rotation),
- output->x, output->y);
+ if (crtc_info) {
+ printf (" %dx%d+%d+%d",
+ crtc_info->width, crtc_info->height,
+ crtc_info->x, crtc_info->y);
+ } else {
+ printf (" %dx%d+%d+%d",
+ mode->width, mode->height, output->x, output->y);
+ }
if (verbose)
- printf (" (0x%x)", mode->id);
+ printf (" (0x%x)", (int)mode->id);
if (output->rotation != RR_Rotate_0 || verbose)
{
printf (" %s",
@@ -2307,14 +2842,36 @@ main (int argc, char **argv)
if (mode)
{
printf (" %dmm x %dmm",
- output_info->mm_width, output_info->mm_height);
+ (int)output_info->mm_width, (int)output_info->mm_height);
+ }
+
+ if (crtc && crtc->panning_info && crtc->panning_info->width > 0)
+ {
+ XRRPanning *pan = crtc->panning_info;
+ printf (" panning %dx%d+%d+%d",
+ pan->width, pan->height, pan->left, pan->top);
+ if ((pan->track_width != 0 &&
+ (pan->track_left != pan->left ||
+ pan->track_width != pan->width ||
+ pan->border_left != 0 ||
+ pan->border_right != 0)) ||
+ (pan->track_height != 0 &&
+ (pan->track_top != pan->top ||
+ pan->track_height != pan->height ||
+ pan->border_top != 0 ||
+ pan->border_bottom != 0)))
+ printf (" tracking %dx%d+%d+%d border %d/%d/%d/%d",
+ pan->track_width, pan->track_height,
+ pan->track_left, pan->track_top,
+ pan->border_left, pan->border_top,
+ pan->border_right, pan->border_bottom);
}
printf ("\n");
if (verbose)
{
- printf ("\tIdentifier: 0x%x\n", output->output.xid);
- printf ("\tTimestamp: %d\n", output_info->timestamp);
+ printf ("\tIdentifier: 0x%x\n", (int)output->output.xid);
+ printf ("\tTimestamp: %d\n", (int)output_info->timestamp);
printf ("\tSubpixel: %s\n", order[output_info->subpixel_order]);
printf ("\tClones: ");
for (j = 0; j < output_info->nclone; j++)
@@ -2334,6 +2891,33 @@ main (int argc, char **argv)
printf (" %d", crtc->crtc.index);
}
printf ("\n");
+ if (output->crtc_info && output->crtc_info->panning_info) {
+ XRRPanning *pan = output->crtc_info->panning_info;
+ printf ("\tPanning: %dx%d+%d+%d\n",
+ pan->width, pan->height, pan->left, pan->top);
+ printf ("\tTracking: %dx%d+%d+%d\n",
+ pan->track_width, pan->track_height,
+ pan->track_left, pan->track_top);
+ printf ("\tBorder: %d/%d/%d/%d\n",
+ pan->border_left, pan->border_top,
+ pan->border_right, pan->border_bottom);
+ }
+ }
+ if (verbose)
+ {
+ int x, y;
+
+ printf ("\tTransform: ");
+ for (y = 0; y < 3; y++)
+ {
+ for (x = 0; x < 3; x++)
+ printf (" %f", XFixedToDouble (output->transform.transform.matrix[y][x]));
+ if (y < 2)
+ printf ("\n\t ");
+ }
+ if (output->transform.filter)
+ printf ("\n\t filter: %s", output->transform.filter);
+ printf ("\n");
}
if (verbose || properties)
{
@@ -2369,26 +2953,35 @@ main (int argc, char **argv)
} else if (actual_type == XA_INTEGER &&
actual_format == 32)
{
- printf("\t%s: %d (0x%08x)",
- XGetAtomName (dpy, props[j]),
- *(INT32 *)prop, *(INT32 *)prop);
+ printf("\t%s: ", XGetAtomName (dpy, props[j]));
+ for (k = 0; k < nitems; k++) {
+ if (k > 0)
+ printf ("\n\t\t\t");
+ printf("%d (0x%08x)",
+ (int)((INT32 *)prop)[k], (int)((INT32 *)prop)[k]);
+ }
if (propinfo->range && propinfo->num_values > 0) {
- printf(" range%s: ",
+ if (nitems > 1)
+ printf ("\n\t\t");
+ printf("\trange%s: ",
(propinfo->num_values == 2) ? "" : "s");
for (k = 0; k < propinfo->num_values / 2; k++)
- printf(" (%d,%d)", propinfo->values[k * 2],
- propinfo->values[k * 2 + 1]);
+ printf(" (%d,%d)", (int)propinfo->values[k * 2],
+ (int)propinfo->values[k * 2 + 1]);
}
printf("\n");
} else if (actual_type == XA_ATOM &&
actual_format == 32)
{
- printf("\t%s: %s",
- XGetAtomName (dpy, props[j]),
- XGetAtomName (dpy, *(Atom *)prop));
+ printf("\t%s:", XGetAtomName (dpy, props[j]));
+ for (k = 0; k < nitems; k++) {
+ if (k > 0 && (k & 1) == 0)
+ printf ("\n\t\t");
+ printf("\t%s", XGetAtomName (dpy, ((Atom *)prop)[k]));
+ }
if (!propinfo->range && propinfo->num_values > 0) {
printf("\n\t\tsupported:");
@@ -2402,12 +2995,14 @@ main (int argc, char **argv)
}
}
printf("\n");
-
} else if (actual_format == 8) {
- printf ("\t\t%s: %s%s\n", XGetAtomName (dpy, props[j]),
+ printf ("\t%s: %s%s\n", XGetAtomName (dpy, props[j]),
prop, bytes_after ? "..." : "");
} else {
- printf ("\t\t%s: ????\n", XGetAtomName (dpy, props[j]));
+ char *type = actual_type ? XGetAtomName (dpy, actual_type) : "none";
+ printf ("\t%s: %s(%d) (format %d items %d) ????\n",
+ XGetAtomName (dpy, props[j]),
+ type, (int)actual_type, actual_format, (int)nitems);
}
free(propinfo);
@@ -2422,7 +3017,7 @@ main (int argc, char **argv)
int f;
printf (" %s (0x%x) %6.1fMHz",
- mode->name, mode->id,
+ mode->name, (int)mode->id,
(float)mode->dotClock / 1000000.0);
for (f = 0; mode_flags[f].flag; f++)
if (mode->modeFlags & mode_flags[f].flag)
@@ -2483,7 +3078,7 @@ main (int argc, char **argv)
if (!(mode->modeFlags & ModeShown))
{
printf (" %s (0x%x) %6.1fMHz\n",
- mode->name, mode->id,
+ mode->name, (int)mode->id,
(float)mode->dotClock / 1000000.0);
printf (" h: width %4d start %4d end %4d total %4d skew %4d clock %6.1fKHz\n",
mode->width, mode->hSyncStart, mode->hSyncEnd,
@@ -2630,7 +3225,7 @@ main (int argc, char **argv)
if (setit && !dryrun) XRRSelectInput (dpy, root,
RRScreenChangeNotifyMask);
if (setit && !dryrun) status = XRRSetScreenConfigAndRate (dpy, sc,
- DefaultRootWindow (dpy),
+ root,
(SizeID) size, (Rotation) (rotation | reflection), rate, CurrentTime);
XRRQueryExtension(dpy, &event_base, &error_base);
diff --git a/app/xrandr/xrandr.man b/app/xrandr/xrandr.man
index c6bbd4203..e3d7dafcf 100644
--- a/app/xrandr/xrandr.man
+++ b/app/xrandr/xrandr.man
@@ -1,5 +1,6 @@
.\"
-.\" Copyright 2001 Keith Packard.\"
+.\" Copyright 2001 Keith Packard
+.\"
.\" 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
@@ -29,42 +30,60 @@ xrandr \- primitive command line interface to RandR extension
[\-help] [\-display \fIdisplay\fP]
[\-q] [\-v]
[\-\-verbose]
+[\-\-dryrun]
[\-\-screen \fIsnum\fP]
+[\-\-q1]
+[\-\-q12]
+.br
+.B RandR version 1.3 options
+.br
+[\-\-current]
+[\-\-noprimary]
+.br
+.B Per-output options
+.br
+[\-\-panning \fIwidth\fPx\fIheight\fP[+\fIx\fP+\fIy\fP[/\fItrack_width\fPx\fItrack_height\fP+\fItrack_x\fP+\fItrack_y\fP[/\fIborder_left\fP/\fIborder_top\fP/\fIborder_right\fP/\fIborder_bottom\fP]]]]
+[\-\-scale \fIx\fPx\fIy\fP]
+[\-\-transform \fIa\fP,\fIb\fP,\fIc\fP,\fId\fP,\fIe\fP,\fIf\fP,\fIg\fP,\fIh\fP,\fIi\fP]
+[\-\-primary]
.br
.B RandR version 1.2 options
.br
[\-\-prop]
-[\-\-fb <width>x<height>]
-[\-\-fbmm <width>x<height>]
-[\-\-dpi <dpi>]
+[\-\-fb \fIwidth\fPx\fIheight\fP]
+[\-\-fbmm \fIwidth\fPx\fIheight\fP]
+[\-\-dpi \fIdpi\fP]
+[\-\-newmode \fIname\fP \fImode\fP]
+[\-\-rmmode \fIname\fP]
+[\-\-addmode \fIoutput\fP \fIname\fP]
+[\-\-delmode \fIoutput\fP \fIname\fP]
.br
.B Per-output options
.br
-[\-\-output <output>]
+[\-\-output \fIoutput\fP]
[\-\-auto]
-[\-\-mode <mode>]
+[\-\-mode \fImode\fP]
[\-\-preferred]
-[\-\-pos <x>x<y>]
-[\-\-rate <rate>]
+[\-\-pos \fIx\fPx\fIy\fP]
+[\-\-rate \fIrate\fP]
[\-\-reflect \fIreflection\fP]
[\-\-rotate \fIorientation\fP]
-[\-\-left\-of <output>\]
-[\-\-right\-of <output>\]
-[\-\-above <output>\]
-[\-\-below <output>\]
-[\-\-same-as <output>\]
-[\-\-set <property> <value>]
+[\-\-left\-of \fIoutput\fP\]
+[\-\-right\-of \fIoutput\fP\]
+[\-\-above \fIoutput\fP\]
+[\-\-below \fIoutput\fP\]
+[\-\-same-as \fIoutput\fP\]
+[\-\-set \fIproperty\fP \fIvalue\fP]
[\-\-off]
-[\-\-crtc <crtc>]
-[\-\-newmode <name> \fImode\fP]
-[\-\-rmmode <name>]
-[\-\-addmode <output> <name>]
-[\-\-delmode <output> <name>]
+[\-\-crtc \fIcrtc\fP]
+[\-\-gamma \fIred\fP:\fIgreen\fP:\fIblue\fP]
+
.br
.B RandR version 1.0 and version 1.1 options
.br
[\-o \fIorientation\fP]
[\-s \fIsize\fP]
+[\-r \fIrate\fP]
[\-x] [\-y]
.SH DESCRIPTION
.I Xrandr
@@ -77,59 +96,141 @@ mode and a '*' after the current mode.
There are a few global options. Other options modify the last output that is
specified in earlier parameters in the command line. Multiple outputs may
-be modified at the same time by passing mutiple \-\-output options followed
+be modified at the same time by passing multiple \-\-output options followed
immediately by their corresponding modifying options.
-.IP \-\-help
+.IP \-help
Print out a summary of the usage and exit.
-.IP \-v
+.IP "\-v, \-\-version"
Print out the RandR version reported by the X server and exit.
.IP \-\-verbose
-causes xrandr to be more verbose. When used with \-q (or without other
+Causes xrandr to be more verbose. When used with \-q (or without other
options), xrandr will display more information about the server state. When
used along with options that reconfigure the system, progress will be
reported while executing the configuration changes.
-.IP \-q
+.IP "\-q, \-\-query"
When this option is present, or when no configuration changes are requested,
-xrandr will display the current state of the system.
-.IP "\-screen \fIsnum\fP"
+xrandr will display the current state of the system.
+.IP "\-\-dryrun"
+Performs all the actions specified except that no changes are made.
+.IP "\-d, \-display \fIname\fP"
+This option selects the X display to use. Note this refers to the X
+screen abstraction, not the monitor (or output).
+.IP "\-\-screen \fIsnum\fP"
This option selects which screen to manipulate. Note this refers to the X
screen abstraction, not the monitor (or output).
+.IP \-\-q1
+Forces the usage of the RandR version 1.1 protocol, even if a higher version
+is available.
+.IP \-\-q12
+Forces the usage of the RandR version 1.2 protocol, even if the display does
+not report it as supported or a higher version is available.
+.PP
+.SH "RandR version 1.3 options"
+.PP
+Options for RandR 1.3 are used as a superset of the options for RandR 1.2.
+.PP
+.IP \-\-current
+Return the current screen configuration, without polling for hardware changes.
+.IP \-\-noprimary
+Don't define a primary output.
+.PP
+.B "Per-output options"
+.IP "\-\-panning \fIwidth\fPx\fIheight\fP[+\fIx\fP+\fIy\fP[/\fItrack_width\fPx\fItrack_height\fP+\fItrack_x\fP+\fItrack_y\fP[/\fIborder_left\fP/\fIborder_top\fP/\fIborder_right\fP/\fIborder_bottom\fP]]]"
+This option sets the panning parameters. As soon as panning is
+enabled, the CRTC position can change with every pointer move.
+The first four parameters specify the total panning area, the next four the
+pointer tracking area (which defaults to the same area). The last four
+parameters specify the border and default to 0. A width or height set to zero
+disables panning on the according axis. You typically have to set the screen
+size with \fI--fb\fP simultaneously.
+.IP "\-\-transform \fIa\fP,\fIb\fP,\fIc\fP,\fId\fP,\fIe\fP,\fIf\fP,\fIg\fP,\fIh\fP,\fIi\fP"
+Specifies a transformation matrix to apply on the output. Automatically a bilinear filter is selected.
+The mathematical form corresponds to:
+.RS
+.RS
+a b c
+.br
+d e f
+.br
+g h i
+.RE
+The transformation matrix multiplied by a coordinate vector of a pixel of the
+output (extended to 3 values) gives the approximate coordinate vector of a pixel
+in the graphic buffer. Typically, \fIa\fP and
+\fIe\fP corresponds to the scaling on the X and Y axes, \fIc\fP and \fIf\fP
+corresponds to the tranlastion on those axes, and \fIg\fP, \fIh\fP, and \fIi\fP
+are respectively 0, 0 and 1. It also allows to express a rotation of an angle T
+with:
+.RS
+cos T -sin T 0
+.br
+sin T cos T 0
+.br
+ 0 0 1
+.RE
+As a special argument, instead of
+passing a matrix, one can pass the string \fInone\fP, in which case the default
+values are used (a unit matrix without filter).
+.IP "\-\-scale \fIx\fPx\fIy\fP"
+Changes the dimensions of the output picture. Values superior to 1 will lead to
+a compressed screen (screen dimension bigger than the dimension of the output
+mode), and values below 1 leads to a zoom in on the output. This option is
+actually a shortcut version of the \fI\-\-transform\fP option.
+.IP \-\-primary
+Set the output as primary.
+It will be sorted first in Xinerama and RANDR geometry requests.
+.PP
.SH "RandR version 1.2 options"
These options are only available for X server supporting RandR version 1.2
or newer.
-.IP \-\-prop
+.IP "\-\-prop, \-\-properties"
This option causes xrandr to display the contents of properties for each
output. \-\-verbose also enables \-\-prop.
-.IP "\-\-fb <width>x<height>"
+.IP "\-\-fb \fIwidth\fPx\fIheight\fP"
Reconfigures the screen to the specified size. All configured monitors must
fit within this size. When this option is not provided, xrandr computes the
smallest screen size that will hold the set of configured outputs; this
option provides a way to override that behaviour.
-.IP "\-\-fbmm <width>x<height>"
+.IP "\-\-fbmm \fIwidth\fPx\fIheight\fP"
Sets the reported values for the physical size of the screen. Normally,
xrandr resets the reported physical size values to keep the DPI constant.
This overrides that computation.
-.IP "\-\-dpi <dpi>"
+.IP "\-\-dpi \fIdpi\fP"
This also sets the reported physical size values of the screen, it uses the
specified DPI value to compute an appropriate physical size using whatever
pixel size will be set.
+.IP "\-\-newmode \fIname\fP \fImode\fP"
+New modelines can be added to the server and then associated with outputs.
+This option does the former. The \fImode\fP is specified using the ModeLine
+syntax for xorg.conf: hdisp hsyncstart hsyncend htotal vdisp vsyncstart
+vsyncend vtotal \fIflags\fP. \fIflags\fP can be zero or more of +HSync,
+-HSync, +VSync, -VSync, Interlace, DoubleScan, CSync, +CSync, -CSync. Several
+tools permit to compute the usual modeline from a height, width, and refresh
+rate, for instance you can use \fBcvt\fR.
+.IP "\-\-rmmode \fIname\fP"
+This removes a mode from the server if it is otherwise unused.
+.IP "\-\-addmode \fIoutput\fP \fIname\fP"
+Add a mode to the set of valid modes for an output.
+.IP "\-\-delmode \fIoutput\fP \fIname\fP"
+Remove a mode from the set of valid modes for an output.
.PP
.B "Per-output options"
-.IP "\-\-output <output>"
+.IP "\-\-output \fIoutput\fP"
Selects an output to reconfigure. Use either the name of the output or the
XID.
.IP \-\-auto
For connected but disabled outputs, this will enable them using their
preferred mode (or, something close to 96dpi if they have no preferred
mode). For disconnected but enabled outputs, this will disable them.
-.IP "\-\-mode <mode>"
-This selects a mode. Use either the name or the XID for <mode>
+.IP "\-\-mode \fImode\fP"
+This selects a mode. Use either the name or the XID for \fImode\fP
.IP "\-\-preferred"
This selects the same mode as \-\-auto, but it doesn't automatically enable or
disable the output.
-.IP "\-\-pos <x>x<y>"
-Position the output within the screen using pixel coordinates.
-.IP "\-\-rate <rate>"
+.IP "\-\-pos \fIx\fPx\fIy\fP"
+Position the output within the screen using pixel coordinates. In case reflection
+or rotation is applied, the translation is applied after the effects.
+.IP "\-\-rate \fIrate\fP"
This marks a preference for refresh rates close to the specified value, when
multiple modes have the same name, this will select the one with the nearest
refresh rate.
@@ -138,54 +239,77 @@ Reflection can be one of 'normal' 'x', 'y' or 'xy'. This causes the output
contents to be reflected across the specified axes.
.IP "\-\-rotate \fIrotation\fP"
Rotation can be one of 'normal', 'left', 'right' or 'inverted'. This causes
-the output contents to be rotated in the specified direction.
-.IP "\-\-left\-of, \-\-right\-of, \-\-above, \-\-below, \-\-same-as <another output>"
+the output contents to be rotated in the specified direction. 'right' specifies
+a clockwise rotation of the picture and 'left' specifies a counter-clockwise
+rotation.
+.IP "\-\-left\-of, \-\-right\-of, \-\-above, \-\-below, \-\-same-as \fIanother-output\fP"
Use one of these options to position the output relative to the position of
another output. This allows convenient tiling of outputs within the screen.
The position is always computed relative to the new position of the other
output, so it is not valid to say \-\-output a \-\-left\-of b \-\-output
b \-\-left\-of a.
-.IP "\-\-set <property> <value>"
+.IP "\-\-set \fIproperty\fP \fIvalue\fP"
Sets an output property. Integer properties may be specified as a valid
(see \-\-prop) decimal or hexadecimal (with a leading 0x) value. Atom properties
may be set to any of the valid atoms (see \-\-prop). String properties may be
set to any value.
.IP "\-\-off"
Disables the output.
-.IP "\-\-crtc <crtc>"
+.IP "\-\-crtc \fIcrtc\fP"
Uses the specified crtc (either as an index in the list of CRTCs or XID).
In normal usage, this option is not required as xrandr tries to make
sensible choices about which crtc to use with each output. When that fails
for some reason, this option can override the normal selection.
-.IP "\-\-newmode <name> \fImode\fP"
-New modelines can be added to the server and then associated with outputs.
-This option does the former. The \fImode\fP is specified using the ModeLine
-syntax for xorg.conf: hdisp hsyncstart hsyncend htotal vdisp vsyncstart
-vsyncend vtotal \fIflags\fP. \fIflags\fP can be zero or more of +HSync,
--HSync, +VSync, -VSync, Interlace, DoubleScan, CSync, +CSync, -CSync.
-.IP "\-\-rmmode <name>"
-This removes a mode from the server if it is otherwise unused.
-.IP "\-\-addmode <output> <name>"
-Add a mode to the set of valid modes for an output.
-.IP "\-\-delmode <output> <name>"
-Remove a mode from the set of valid modes for an output.
+.IP "\-\-gamma \fIred\fP:\fIgreen\fP:\fIblue\fP"
+Set the specified floating point values as gamma correction on the crtc
+currently attached to this output. Note that you cannot get two different values
+for cloned outputs and that switching an output to another crtc doesn't change
+the crtc gamma corrections at all.
.PP
.SH "RandR version 1.1 options"
These options are available for X servers supporting RandR version 1.1 or
older. They are still valid for newer X servers, but they don't interact
sensibly with version 1.2 options on the same command line.
-.IP "\-s <size index> or \-s <width>x<height>"
+.IP "\-s, \-\-size \fIsize-index\fP or \-\-size \fIwidth\fPx\fIheight\fP"
This sets the screen size, either matching by size or using the index into
the list of available sizes.
-.IP "\-o \fIrotation\fP"
+.IP "\-r, \-\-rate, \-\-refresh \fIrate\fP"
+This sets the refresh rate closest to the specified value.
+.IP "\-o, \-\-orientation \fIrotation\fP"
This specifies the orientation of the screen,
and can be one of normal, inverted, left or right.
.IP \-x
Reflect across the X axis.
.IP \-y
Reflect across the Y axis.
+.SH EXAMPLES
+Sets an output called LVDS to its preferred mode, and on its right put an
+output called VGA to preferred mode of a screen which has been physically rotated clockwise:
+.RS
+xrandr --output LVDS --auto --rotate normal --pos 0x0 --output VGA --auto --rotate left --right-of LVDS
+.RE
+.PP
+Forces to use a 1024x768 mode on an output called VGA:
+.RS
+xrandr --newmode "1024x768" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
+.br
+xrandr --addmode VGA 1024x768
+.br
+xrandr --output VGA --mode 1024x768
+.RE
+.PP
+Enables panning on a 1600x768 desktop while displaying 1024x768 mode on an output called VGA:
+.RS
+xrandr --fb 1600x768 --output VGA --mode 1024x768 --panning 1600x0
+.RE
+.PP
+Have one small 1280x800 LVDS screen showing a small version of a huge 3200x2000 desktop, and have a
+big VGA screen display the surrounding of the mouse at normal size.
+.RS
+xrandr --fb 3200x2000 --output LVDS --scale 2.5x2.5 --output VGA --pos 0x0 --panning 3200x2000+0+0/3200x2000+0+0/64/64/64/64
+.RE
.SH "SEE ALSO"
-Xrandr(3)
+Xrandr(3), cvt(1)
.SH AUTHORS
Keith Packard,
Open Source Technology Center, Intel Corporation.