Skip to content

Commit

Permalink
ignore 'primary' in xrandr output
Browse files Browse the repository at this point in the history
since 1.4.0, xrandr indicates which output is currently primary; this
patch ignores that and restores xrandr 1.4.0 compatibility.

note that the version detection didn't work for the affected users, as
--version also prints the server's xrandr version, which was still 1.3.
  • Loading branch information
chrysn committed Feb 28, 2013
1 parent dad11f9 commit fd3dc6f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Fix the 'primary' issue
- ignores the primary keyword
- makes ARandR compatible with xrandr 1.4.0
* Merged parts of the cglita branch
- solves ValueError / "1080p" issue
* New translations:
Expand Down
3 changes: 3 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ ARandR TODO list
5. arandr knows what he sees and can position displays and offer to apply a matrix

* be more intelligent about future xrandr versions (cf debian #523903)

* parse versions instead of just looking for a string -- '1.3' in output_string won't help detecting an 1.4 client that spews new keywords

* read --props, parse edid (using parse-edid from read-edid; dispcalGUI has dispcalGUI/edid.py with a parse_edid that just works), maybe even offer setting properties

* sigrok has a pure python implementation at http://sigrok.git.sourceforge.net/git/gitweb.cgi?p=sigrok/sigrok;a=blob;f=libsigrokdecode/decoders/edid/edid.py
Expand Down
5 changes: 4 additions & 1 deletion screenlayout/xrandr.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, display=None, force_version=False):
self.environ['DISPLAY'] = display

version_output = self._output("--version")
if not ("1.2" in version_output or "1.3" in version_output) and not force_version:
if not ("1.2" in version_output or "1.3" in version_output or "1.4" in version_output) and not force_version:
raise Exception("XRandR 1.2/1.3 required.")

def _get_outputs(self):
Expand Down Expand Up @@ -135,6 +135,9 @@ def load_from_x(self): # FIXME -- use a library

o.connected = (hsplit[1] in ('connected', 'unknown-connection'))

if 'primary' in hsplit:
hsplit.remove('primary')

if not hsplit[2].startswith("("):
active = True

Expand Down

0 comments on commit fd3dc6f

Please sign in to comment.