Skip to content
  • hikalium's avatar
    ui/gtk: Fix mouse/motion event scaling issue with GTK display backend · 37e91415
    hikalium authored and Marc-André Lureau's avatar Marc-André Lureau committed
    Remove gtk_widget_get_scale_factor() usage from the calculation of
    the motion events in the GTK backend to make it work correctly on
    environments that have `gtk_widget_get_scale_factor() != 1`.
    
    This scale factor usage had been introduced in the commit f14aab42 and
    at that time the window size was used for calculating the things and it
    was working correctly. However, in the commit 2f31663e the logic
    switched to use the widget size instead of window size and because of
    the change the usage of scale factor becomes invalid (since widgets use
    `vc->gfx.scale_{x, y}` for scaling).
    
    Tested on Crostini on ChromeOS (15823.51.0) with an external display.
    
    Fixes: 2f31663e ("ui/gtk: use widget size for cursor motion event")
    Fixes: f14aab42
    
     ("ui: fix incorrect pointer position on highdpi with
    gtk")
    
    Signed-off-by: default avatarhikalium <hikalium@hikalium.com>
    Acked-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20240512111435.30121-3-h...
    37e91415