Skip to content
Snippets Groups Projects
  • Daniel P. Berrangé's avatar
    69cc8db4
    ui: honour the actual guest display dimensions without rounding · 69cc8db4
    Daniel P. Berrangé authored
    
    A long time ago the VNC server code had some memory corruption
    fixes done in:
    
      commit bea60dd7
      Author: Peter Lieven <pl@kamp.de>
      Date:   Mon Jun 30 10:57:51 2014 +0200
    
        ui/vnc: fix potential memory corruption issues
    
    One of the implications of the fix was that the VNC server would have a
    thin black bad down the right hand side if the guest desktop width was
    not a multiple of 16. In practice this was a non-issue since the VNC
    server was always honouring a guest specified resolution and guests
    essentially always pick from a small set of sane resolutions likely in
    real world hardware.
    
    We recently introduced support for the extended desktop resize extension
    and as a result the VNC client has ability to specify an arbitrary
    desktop size and the guest OS may well honour it exactly. As a result we
    no longer have any guarantee that the width will be a multiple of 16,
    and so when resizing the desktop we have a 93% chance of getting the
    black bar on the right hand size.
    
    The VNC server maintains three different desktop dimensions
    
     1. The guest surface
     2. The server surface
     3. The client desktop
    
    The requirement for the width to be a multiple of 16 only applies to
    item 2, the server surface, for the purpose of doing dirty bitmap
    tracking.
    
    Normally we will set the client desktop size to always match the server
    surface size, but that's not a strict requirement. In order to cope with
    clients that don't support the desktop size encoding, we already allow
    for the client desktop to be a different size that the server surface.
    
    Thus we can trivially eliminate the black bar, but setting the client
    desktop size to be the un-rounded server surface size - the so called
    "true width".
    
    Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20210311182957.486939-5-berrange@redhat.com>
    Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
    69cc8db4
    History
    ui: honour the actual guest display dimensions without rounding
    Daniel P. Berrangé authored
    
    A long time ago the VNC server code had some memory corruption
    fixes done in:
    
      commit bea60dd7
      Author: Peter Lieven <pl@kamp.de>
      Date:   Mon Jun 30 10:57:51 2014 +0200
    
        ui/vnc: fix potential memory corruption issues
    
    One of the implications of the fix was that the VNC server would have a
    thin black bad down the right hand side if the guest desktop width was
    not a multiple of 16. In practice this was a non-issue since the VNC
    server was always honouring a guest specified resolution and guests
    essentially always pick from a small set of sane resolutions likely in
    real world hardware.
    
    We recently introduced support for the extended desktop resize extension
    and as a result the VNC client has ability to specify an arbitrary
    desktop size and the guest OS may well honour it exactly. As a result we
    no longer have any guarantee that the width will be a multiple of 16,
    and so when resizing the desktop we have a 93% chance of getting the
    black bar on the right hand size.
    
    The VNC server maintains three different desktop dimensions
    
     1. The guest surface
     2. The server surface
     3. The client desktop
    
    The requirement for the width to be a multiple of 16 only applies to
    item 2, the server surface, for the purpose of doing dirty bitmap
    tracking.
    
    Normally we will set the client desktop size to always match the server
    surface size, but that's not a strict requirement. In order to cope with
    clients that don't support the desktop size encoding, we already allow
    for the client desktop to be a different size that the server surface.
    
    Thus we can trivially eliminate the black bar, but setting the client
    desktop size to be the un-rounded server surface size - the so called
    "true width".
    
    Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20210311182957.486939-5-berrange@redhat.com>
    Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>