New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Xorg monitor layout in VM when changed in dom0 #731

Closed
marmarek opened this Issue Mar 8, 2015 · 4 comments

Comments

Projects
None yet
1 participant
@marmarek
Member

marmarek commented Mar 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

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

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:

  1. implement XRANDR in dummy_drv
  2. 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.
  3. announce monitor layout to Xorg (some additional xorg.conf options?)
  4. 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:

Member

marmarek commented Mar 8, 2015

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:

  1. implement XRANDR in dummy_drv
  2. 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.
  3. announce monitor layout to Xorg (some additional xorg.conf options?)
  4. 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:

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

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:

  1. Extend xorg dummy driver to blindly accept xrandr commands (almost done)
  2. Create Qubes-RPC service to set screen layout (simple bash script with series of xrandr calls)
  3. Implement screen size update in gui-daemon (it needs only maximum screen size, not detailed layout).
  4. 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)
Member

marmarek commented Mar 8, 2015

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:

  1. Extend xorg dummy driver to blindly accept xrandr commands (almost done)
  2. Create Qubes-RPC service to set screen layout (simple bash script with series of xrandr calls)
  3. Implement screen size update in gui-daemon (it needs only maximum screen size, not detailed layout).
  4. 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)

@marmarek marmarek self-assigned this Mar 8, 2015

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

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.

Member

marmarek commented Mar 8, 2015

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.

@marmarek

This comment has been minimized.

Show comment
Hide comment

@marmarek marmarek closed this Mar 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment