[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#538800: /usr/bin/xrandr: setting non-existent output as primary resets screen ordering



2009/7/27 Michal Suchanek <hramrach@centrum.cz>:
> 2009/7/27 Brice Goglin <Brice.Goglin@ens-lyon.org>:
>> Michal Suchanek wrote:
>>> Package: x11-xserver-utils
>>> Version: 7.4+2
>>> Severity: normal
>>> File: /usr/bin/xrandr
>>>
>>>
>>> In my .xsessionrc I set up the screen layout with xrandr.
>>> Because different drivers name the outputs differently I have the
>>> commands repeated with different output names.
>>>
>>> All works fine except for --primary.
>>>
>>> Setting non-existent output as primary resets the output order to the
>>> driver default.
>>>
>>
>> It looks like xrandr is passing the request with the wrong output up to
>> the server. Then the server probably clears the primary status before it
>> fails to setup the new primary output. So there's no primary output
>> anymore. Patch welcome :)
>
> Since the outputs are passed as CARD32 in the request it's probably
> xrandr's fault it resolves the string into a number which it passes to
> the X server.
>
> The X server validates the number and only proceeds to set the output
> if it received what it thinks to be a valid number.
>

The xrandr source is a mess. I tried adding some debug prints in
find_output and it seems that xrandr does not find the output but sets
something somewhere anyway, even if --dryrun is specified.

~/x11-xserver-utils-7.4+2/xrandr/build $ ./xrandr --dryrun --output
DVI-0 --primary
find_output_by_name: DVI-0: find_output: (nil)
find_output: (nil)
find_output: DVI-0, 0, 0x00000000
find_output: (nil)
find_output_by_xid: 0x0000004d: find_output: DVI-0, 0, 0x0000004d
find_output_by_xid: 0x0000004d: find_output: DVI-0, 0, 0x0000004d
find_output_by_xid: 0x0000004c: find_output: VGA-0, 0, 0x0000004c
crtc 0:    1280x1024   60.0 +0+0 "DVI-0"

~/x11-xserver-utils-7.4+2/xrandr/build $ ./xrandr --dryrun --output
DVI --primary
find_output_by_name: DVI: find_output: (nil)
find_output: (nil)
find_output: (nil)
find_output: (nil)
find_output_by_xid: 0x0000004d: find_output: DVI-0, 1, 0x0000004d
find_output_by_xid: 0x0000004c: find_output: VGA-0, 0, 0x0000004c



Reply to: