Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upUpdate Xorg monitor layout in VM when changed in dom0 #731
Comments
marmarek
added this to the Release 2 Beta 3 milestone
Mar 8, 2015
marmarek
added
bug
C: gui-virtualization
P: major
labels
Mar 8, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Mar 8, 2015
Member
Comment by marmarek on 10 Jun 2013 01:53 UTC
Currenctly Xorg dummy_drv doesn't support XRANDR externsion so it isn't possible to update screen size on the fly. The ideal solution would be:
- implement XRANDR in dummy_drv
- send full monitor layout to VM at start (not only whole screen size) - most likely new protocol message will be needed for it, or series of msg_xconf.
- announce monitor layout to Xorg (some additional xorg.conf options?)
- detect monitor layout change in dom0 (gui-daemon task) and send it to VM (gui-agent), which update Xorg settings (XRANDR extension)
Some assorted hints/links/thoughts:
- GUI protocol should be as simple as possible (from parsing POV). For starters avoid variable length fields (but variable count of messages is ok). So monitor layout could be send as series of messages (one per monitor) with simple fields: width, height, position (x,y).
- VM: xorg.conf is generated here: http://git.qubes-os.org/?p=marmarek/gui-agent-linux.git;a=blob;f=appvm-scripts/usrbin/qubes-run-xorg.sh;h=d1fcad5584f4b730f4ec6bdda67b1c93e7f59f6d;hb=HEAD
- https://www.xpra.org/trac/ticket/56 - some links and info about similar problem
- http://cgit.freedesktop.org/xorg/xserver/tree/hw/xfree86/doc/README.modes - some documentation on monitor configuration API
- https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Additions/x11/vboxvideo - quite clear example of implementation (i.e. not trashed with many hardware-specific code)
|
Comment by marmarek on 10 Jun 2013 01:53 UTC
Some assorted hints/links/thoughts:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Mar 8, 2015
Member
Comment by marmarek on 7 Aug 2013 15:52 UTC
Status: dummy drv xrandr support almost done. Actually gui-agent doesn't need to be changed at all - it event isn't aware of screen size (apart from creating xorg.conf).
So current approach is:
- Extend xorg dummy driver to blindly accept xrandr commands (almost done)
- Create Qubes-RPC service to set screen layout (simple bash script with series of xrandr calls)
- Implement screen size update in gui-daemon (it needs only maximum screen size, not detailed layout).
- Add some hook for monitor layout change in dom0 (preferably without constant polling...), which will notify:
- all gui-daemons
- all VMs (via Qubes-RPC service)
|
Comment by marmarek on 7 Aug 2013 15:52 UTC
|
marmarek
self-assigned this
Mar 8, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Mar 8, 2015
Member
Comment by marmarek on 9 Aug 2013 03:04 UTC
Items 1-3 done (both gui-agent-linux and gui-daemon pushed). For item 4 - script written (qubes-monitor-layout-notify), but still needs to be added somewhere to be called automatically.
Current state: calling qubes-monitor-layout-notify synchronize monitor layout in VM with that one in dom0.
Note that is makes sense to call it after VM boot on multi-head system, even if all monitors were connected from the beginning. This is because it will give VM detailed monitor layout, not only the whole screen size.
|
Comment by marmarek on 9 Aug 2013 03:04 UTC Note that is makes sense to call it after VM boot on multi-head system, even if all monitors were connected from the beginning. This is because it will give VM detailed monitor layout, not only the whole screen size. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Mar 8, 2015
Member
Comment by marmarek on 11 Aug 2013 02:18 UTC
Done. I haven't found any existing mechanism for handling XRandr events (or any other about screen layout), so small additional daemon in dom0 is running, which subscribe for XRandr events and calls qubes-monitor-layout-notify.
Essential commits (for the wole feature):
http://git.qubes-os.org/?p=marmarek/gui-agent-linux.git;a=commit;h=518c7c921c96e1dc451d2c3aaea3e1e5ffdd8dfc
http://git.qubes-os.org/?p=marmarek/gui-agent-linux.git;a=commit;h=a825c7a6a24a25ac72001d386abe36180c6afd9e
http://git.qubes-os.org/?p=marmarek/gui-daemon.git;a=commit;h=a36fe00d0cae15460682117eaab0fce28d1cc249
http://git.qubes-os.org/?p=marmarek/gui-daemon.git;a=commit;h=b8c70ac6d119d0370f00d31c6e695c57da0734b3
http://git.qubes-os.org/?p=marmarek/gui-daemon.git;a=commit;h=e27f6f93462d2affedcbb856faca9bceb3c4f883
|
Comment by marmarek on 11 Aug 2013 02:18 UTC Essential commits (for the wole feature): |
marmarek commentedMar 8, 2015
Reported by marmarek on 10 Jun 2013 00:34 UTC
Currently VM gets monitor layout at startup (*), but it isn't updated when some monitor is connected to the system. This means that VM can think of smaller screen than it actually is. Xorg doesn't limit window position to screen (off-screen windows are allowed), but does so for mouse. Effect: mouse doesn't work on just connected monitor.
Current workaround: start system with external monitor (or projector) connected, or restart VMs after connecting such device. Disconnecting such monitor later doesn't introduce any problems - once you've started VM while external monitor is connected, you can use it there, whatever times you've reconnected the monitor.
(*) actually whole screen size, not detailed monitor layout, which also have some drawbacks, like problems with fullscreen mode in some apps
Migrated-From: https://wiki.qubes-os.org/ticket/731