disper -s selects wrong screen
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
disper |
New
|
Undecided
|
Unassigned |
Bug Description
This bug is for the trunk build of disper, version 0.3.99. I am comparing it to disper version 0.3.0 (the one supplied by my distribution)
I am running on OpenSuse 12.2 x86_64 with nvidia binary drivers v304.43. I have a thinkpad that sits in a docking station at work, with two displays plugged in via VGA and DVI. The main laptop screen is off except when I undock. When undocking I run "disper -s" to switch to the laptop screen. When I re-dock, I run "disper --displays=
When running "disper -s" with the trunk build of disper, I get the wrong screen. Since the "-s" flag doesn't accept display arguments I can't force it onto the right screen. I assume it is related to the change in ordering of "disper -l" output I've observed between versions - on the new version the VGA connection is first, on the old one the internal laptop screen is first.
I've attached my the output of both disper versions, the contents of Xorg.0.log, and dmesg output as a concatenated file since I couldn't figure out how to attach multiple files.
Sorry if that's an inconvenience, let me know if there's anything else I can supply.
A bit of debugging work I did to try to figure out what the deal is below.
The list of displays is generated by xrandr.core.Screen, specifically the 'outputs' dict generated in Screen. _load_outputs. I'm reasonably proficient with python but I don't know anything about xrandr, so I naively tried replacing all calls in Screen to self.outputs. values( ) and self.outputs.keys() with self.outputs_ values( ) and self.outputs_ keys(), respectively. They work like this:
def outputs_ values( self): keys(): ('LVDS' ): #internal laptop connector insert( 0, self.outputs[name]) append( self.outputs[ name])
olist = []
for name in self.outputs.
if name.startswith
olist.
else:
olist.
return olist
outputs_keys follows the same principle but with keys instead of values.
When I do this, I get the right output order with "./disper.py -l" and "./disper.py --displays= VGA-0,DP- 2 -e" works like it always did. But "./disper.py -s" throws an exception that begins at Screen. apply_output_ config( ) on the 'raise RRError' line. It's right below a FIXME comment but I doubt that's the issue.
Stepping through the loading code, it appears that the LVDS-0 interface doesn't, in fact, have a crtc set. I don't know nearly enough about xrandr to understand why that would be. However, it looks like the code that sets that functionality involves querying libXrandr.so.2 directly, in Screen. _load_outputs( ):
xrroutputinfo = goi(self._display, self_resources, o[i]) xrroutputinfo, o[i], self) crtc_by_ xid(output. get_crtc( )).
output = Output(
crtc = self.get_
Some investigation via pdb reveals the following: output.get_crtc() returns 0 for 'LVDS-0' and so self.get_ crtc_by_ xid() returns None when I check it in the debugger in LVDS-0's part of the loop. The other two displays return >0 values and self._get_ crtc_by_ xid() returns something. I considered injecting my own values into there from the debugger or via a similar trick to the outputs_keys and outputs_values, but I don't think that's really going to help.
I hope all that helps you out a little, even if it just ends up being a WONTFIX or nVidia driver bug.