QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
542 stars 48 forks source link

XRandR reports 0mm display size #9578

Closed DemiMarie closed 1 week ago

DemiMarie commented 1 week ago

How to file a helpful issue

Qubes OS release

R4.2

Brief summary

Qubes OS trips this warning from winit:

    // See http://xpra.org/trac/ticket/728 for more information.
    if width_mm == 0 || height_mm == 0 {
        warn!("XRandR reported that the display's 0mm in size, which is certifiably insane");
        return 1.0;
    }

This means that the display size is zero, which is obviously nonsense.

Steps to reproduce

Run xrandr. I get the following:

$ xrandr
Screen 0: minimum 64 x 64, current 1920 x 1080, maximum 32767 x 32767
DUMMY0 connected primary 1920x1080+0+0 0mm x 0mm
   QB1920x1080   46.10*+
DUMMY1 disconnected
DUMMY2 disconnected
DUMMY3 disconnected
DUMMY4 disconnected
DUMMY5 disconnected
DUMMY6 disconnected
DUMMY7 disconnected
DUMMY8 disconnected
DUMMY9 disconnected
DUMMY10 disconnected
DUMMY11 disconnected
DUMMY12 disconnected
DUMMY13 disconnected
DUMMY14 disconnected
DUMMY15 disconnected

Expected behavior

Display size is accurate (outside Whonix), or at least non-zero.

Actual behavior

Display size is zero.

alimirjamali commented 1 week ago

The two width_mm_atom and height_mm_atom are currently set to 0 in dummy driver. Hard coding them to a reference display size is not ideal. I guess a protocol bump should allow vmside to query the actual size from the xside.

marmarek commented 1 week ago

Not necessarily. qubes.SetMonitorLayout service should set appropriate size, when it receives it from dom0 (or gui domain). I guess it doesn't get it for some reason.

alimirjamali commented 1 week ago

The unittests for qvm_start_daemon.py makes it evident. The w_mm and h_mm is calculated only for hidpi screens. Overall very easy to fix. This else case should be fixed and unittests should be readjusted. Could I select 96DPI for non-hidpi screens? Arch Wiki mentions it as the most common non-hidpi resolution.

p.s. and while I am at it, maybe switch to Xlib library instead of parsing the xrandr output?