Skip to content
  • hexchain's avatar
    spice-widget: prevent mouse cursor from being too small · 515a84ba
    hexchain authored and Frediano Ziglio's avatar Frediano Ziglio committed
    
    
    Caps the minimum scale of the mouse cursor to 50% so that it is still
    visible even if the window is too small.
    
    This also workarounds a GDK warning when SpiceDisplay is used in
    remote-viewer. Upon its initialization there is a possible race
    condition, where update_mouse_cursor is called but the widget still has
    a size of 1x1. In such case, the calculated scale is very small and the
    mouse surface width and height are both zero, causing a warning:
    
    gdk_cursor_new_from_surface: assertion '0 <= x && x < cairo_image_surface_get_width (surface)' failed
    
    Signed-off-by: default avatarHaochen Tong <i@hexchain.org>
    Acked-by: default avatarFrediano Ziglio <fziglio@redhat.com>
    515a84ba