Bug#512919: xrandr should always fully honour --pos switch
Package: x11-xserver-utils
Version: 7.3+5
Severity: wishlist
Tags: patch
Hello,
the xrandr binary has the following "feature" which I propose to
remove/change:
When you use --pos to position one or more outputs within the large virtual
screen, it first sets the offset(s) as specified on the command line. However,
it then shifts all outputs up and left on the virtual screen such that the
topmost output is always at y=0 and the leftmost one at x=0.
I am not sure why this is done. :-| About the only reason I can imagine is to
avoid problems when the user repeatedly uses e.g. "--right-of" to keep
swapping two screens. If this is the only reason, then the code for
"--right-of" etc. should take care of shifting other outputs to the left to
fit the current output within the virtual screen.
The current behaviour is problematic in at least two cases:
1) It's confusing when you set up screen positions by invoking xrandr more
than once, e.g.:
$ xrandr --output VGA --pos 1280x0
$ xrandr --output LVDS --pos 0x0
If LVDS was disabled and is only enabled by the second command, this will not
work because VGA actually ends up at position 0x0 after the first command.
2) If there is only one output, it can only ever be at position 0x0. I needed
it elsewhere for a VNC-supported dual-screen setup:
I want to set my physical monitor (1280x1024) to display the right half of my
desktop, and then export the left half of the desktop (1400x1050) to a laptop
using VNC, like this:
$ xrandr --fb 2680x1050 --output VGA --pos 1400x0
$ x11vnc -display :0 -clip 1400x1050+0+0 -viewonly -cursorpos -xdamage -xdamage
(Then simply run "xtightvncviewer -fullscreen HOSTNAME" on the laptop.)
Without the output shifting code (see patch), this works fine! This patch is
not intended to be applied as-is; additional code for --right-of etc. would be
required to preserve the behaviour of the existing xrandr tool. Alternatively,
there could be a "--forcepos" switch or similar which disables the position
shifting.
Cheers,
Richard
--- xrandr.c.orig 2009-01-25 00:34:06.000000000 +0100
+++ xrandr.c 2009-01-25 00:34:17.000000000 +0100
@@ -1392,31 +1392,6 @@
if (!any_set)
fatal ("loop in relative position specifications\n");
}
-
- /*
- * Now normalize positions so the upper left corner of all outputs is at 0,0
- */
- min_x = 32768;
- min_y = 32768;
- for (output = outputs; output; output = output->next)
- {
- if (output->mode_info == NULL) continue;
-
- if (output->x < min_x) min_x = output->x;
- if (output->y < min_y) min_y = output->y;
- }
- if (min_x || min_y)
- {
- /* move all outputs */
- for (output = outputs; output; output = output->next)
- {
- if (output->mode_info == NULL) continue;
-
- /*output->x -= min_x;
- output->y -= min_y;
- output->changes |= changes_position;*/
- }
- }
}
static void
-- System Information:
Debian Release: 5.0
APT prefers testing
APT policy: (990, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.28
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages x11-xserver-utils depends on:
ii cpp 4:4.3.2-2 The GNU C preprocessor (cpp)
ii libc6 2.7-18 GNU C Library: Shared libraries
ii libice6 2:1.0.4-1 X11 Inter-Client Exchange library
ii libsm6 2:1.0.3-2 X11 Session Management library
ii libx11-6 2:1.1.5-2 X11 client-side library
ii libxau6 1:1.0.3-3 X11 authorisation library
ii libxaw7 2:1.0.4-2 X11 Athena Widget library
ii libxext6 2:1.0.4-1 X11 miscellaneous extension librar
ii libxi6 2:1.1.4-1 X11 Input extension library
ii libxmu6 2:1.0.4-1 X11 miscellaneous utility library
ii libxmuu1 2:1.0.4-1 X11 miscellaneous micro-utility li
ii libxrandr2 2:1.2.3-1 X11 RandR extension library
ii libxrender1 1:0.9.4-2 X Rendering Extension client libra
ii libxt6 1:1.0.5-3 X11 toolkit intrinsics library
ii libxtrap6 2:1.0.0-5 X11 event trapping extension libra
ii libxxf86misc1 1:1.0.1-3 X11 XFree86 miscellaneous extensio
ii libxxf86vm1 1:1.0.2-1 X11 XFree86 video mode extension l
ii x11-common 1:7.3+18 X Window System (X.Org) infrastruc
x11-xserver-utils recommends no packages.
x11-xserver-utils suggests no packages.
-- no debconf information
Reply to: