1
0
Fork 0
mirror of https://github.com/kbumsik/VirtScreen.git synced 2025-03-09 15:40:18 +00:00

XRandR: Fixed issue with parsing primary screen in some hardware

This commit is contained in:
Bumsik Kim 2018-05-08 11:44:06 -04:00
parent c6a3d8f73d
commit aaf3b28206
No known key found for this signature in database
GPG key ID: E31041C8EC5B01C6

View file

@ -91,12 +91,12 @@ class XRandR(SubprocessWrapper):
def _update_primary_screen(self) -> None: def _update_primary_screen(self) -> None:
output = self.run("xrandr") output = self.run("xrandr")
match = re.search(r"^(\w*)\s+.*primary\s*(\d+)x(\d+)\+(\d+)\+(\d+).*$", output, re.M) match = re.search(r"^(\S*)\s+(connected|disconnected)\s+primary\s+(\d+)x(\d+)\+(\d+)\+(\d+)\s+.*$", output, re.M)
self.primary.name = match.group(1) self.primary.name = match.group(1)
self.primary.width = int(match.group(2)) self.primary.width = int(match.group(3))
self.primary.height = int(match.group(3)) self.primary.height = int(match.group(4))
self.primary.x_offset = int(match.group(4)) self.primary.x_offset = int(match.group(5))
self.primary.y_offset = int(match.group(5)) self.primary.y_offset = int(match.group(6))
def _update_virtual_screen(self) -> None: def _update_virtual_screen(self) -> None:
output = self.run("xrandr") output = self.run("xrandr")