Don't send screen layout to the VM if we haven't received it from xrandr

because this breaks proper initial screen layout set by gui-agent
Fixes QubesOS/qubes-issues#1305 QubesOS/qubes-issues#998
This commit is contained in:
Ivan Konov 2015-10-09 22:52:28 +03:00
parent 4a4d16feb9
commit 78c3f40f89

View File

@ -1678,7 +1678,10 @@ class QubesVm(object):
if verbose:
print >> sys.stderr, "--> Sending monitor layout..."
monitor_layout = qubes.monitorlayoutnotify.get_monitor_layout()
qubes.monitorlayoutnotify.notify_vm(self, monitor_layout)
# Notify VM only if we've got a monitor_layout which is not empty
# or else we break proper VM resolution set by gui-agent
if len(monitor_layout) > 0:
qubes.monitorlayoutnotify.notify_vm(self, monitor_layout)
except ImportError as e:
print >>sys.stderr, "ERROR: %s" % e