Skip to content

Commit

Permalink
Report XRandR display size for lodpi displays
Browse files Browse the repository at this point in the history
  • Loading branch information
alimirjamali committed Nov 15, 2024
1 parent 32e977b commit ff71bc2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion qubesadmin/tests/tools/qvm_start_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def test_050_get_monitor_layout1(self, proc_mock):
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
'''.splitlines()
self.assertEqual(qubesadmin.tools.qvm_start_daemon.get_monitor_layout(),
['1920 1200 0 0\n'])
['1920 1200 0 0 508 317\n'])

@unittest.mock.patch('subprocess.Popen')
def test_051_get_monitor_layout_multiple(self, proc_mock):
Expand Down
14 changes: 6 additions & 8 deletions qubesadmin/tools/qvm_start_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,12 @@ def get_monitor_layout():
elif dpi > 150:
dpi = 150
else:
# if lower, don't provide this info to the VM at all
dpi = 0
if dpi:
# now calculate dimensions based on approximate DPI
phys_size = " {} {}".format(
int(output_params['width']) * 254 // dpi // 10,
int(output_params['height']) * 254 // dpi // 10,
)
dpi = 96
# now calculate dimensions based on approximate DPI
phys_size = " {} {}".format(
int(output_params['width']) * 254 // dpi // 10,
int(output_params['height']) * 254 // dpi // 10,
)
outputs.append("%s %s %s %s%s\n" % (
output_params['width'],
output_params['height'],
Expand Down

0 comments on commit ff71bc2

Please sign in to comment.