Skip to content
Snippets Groups Projects
  • Akihiko Odaki's avatar
    c821a58e
    ui/console: Pass placeholder surface to displays · c821a58e
    Akihiko Odaki authored
    
    ui/console used to accept NULL as graphic console surface, but its
    semantics was inconsistent among displays:
    - cocoa and gtk-egl perform NULL dereference.
    - egl-headless, spice and spice-egl do nothing.
    - gtk releases underlying resources.
    - sdl2-2d and sdl2-gl destroys the window.
    - vnc shows a message, "Display output is not active."
    
    Fortunately, only virtio-gpu and virtio-gpu-3d assign NULL so
    we can study them to figure out the desired behavior. They assign
    NULL *except* for the primary display when the device is realized,
    reset, or its scanout is disabled. This effectively destroys
    windows for the (uninitialized) secondary displays.
    
    To implement the consistent behavior of display device
    realization/reset, this change embeds it to the operation
    switching the surface. When NULL was given as a new surface when
    switching, ui/console will instead passes a placeholder down
    to each display listeners.
    
    sdl destroys the window for a secondary console if its surface is a
    placeholder. The other displays simply shows the placeholder.
    
    Signed-off-by: default avatarAkihiko Odaki <akihiko.odaki@gmail.com>
    Message-Id: <20210225101316.83940-2-akihiko.odaki@gmail.com>
    Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
    c821a58e
    History
    ui/console: Pass placeholder surface to displays
    Akihiko Odaki authored
    
    ui/console used to accept NULL as graphic console surface, but its
    semantics was inconsistent among displays:
    - cocoa and gtk-egl perform NULL dereference.
    - egl-headless, spice and spice-egl do nothing.
    - gtk releases underlying resources.
    - sdl2-2d and sdl2-gl destroys the window.
    - vnc shows a message, "Display output is not active."
    
    Fortunately, only virtio-gpu and virtio-gpu-3d assign NULL so
    we can study them to figure out the desired behavior. They assign
    NULL *except* for the primary display when the device is realized,
    reset, or its scanout is disabled. This effectively destroys
    windows for the (uninitialized) secondary displays.
    
    To implement the consistent behavior of display device
    realization/reset, this change embeds it to the operation
    switching the surface. When NULL was given as a new surface when
    switching, ui/console will instead passes a placeholder down
    to each display listeners.
    
    sdl destroys the window for a secondary console if its surface is a
    placeholder. The other displays simply shows the placeholder.
    
    Signed-off-by: default avatarAkihiko Odaki <akihiko.odaki@gmail.com>
    Message-Id: <20210225101316.83940-2-akihiko.odaki@gmail.com>
    Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>