mirror of
https://github.com/libretro/snes9x.git
synced 2024-12-14 12:38:37 +00:00
Translate mouse coordinates correctly in hidpi modes. Hide cursor when SuperScope enabled.
This commit is contained in:
parent
8fd6346d3d
commit
c555b07846
@ -141,7 +141,7 @@ S9xIsMousePluggedIn (void)
|
||||
for (int i = 0; i <= 1; i++)
|
||||
{
|
||||
S9xGetController (i, &ctl, &id1, &id2, &id3, &id4);
|
||||
if (ctl == CTL_MOUSE)
|
||||
if (ctl == CTL_MOUSE || ctl == CTL_SUPERSCOPE)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -230,12 +230,18 @@ event_motion_notify (GtkWidget *widget,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if GTK_CHECK_VERSION(3,10,0)
|
||||
int scale_factor = gdk_window_get_scale_factor (gtk_widget_get_window (GTK_WIDGET (window->get_window ())));
|
||||
#else
|
||||
int scale_factor = 1;
|
||||
#endif
|
||||
|
||||
window->mouse_loc_x = (uint16)
|
||||
((int) (event->x) - window->mouse_region_x) * 256 /
|
||||
((int) (event->x * scale_factor) - window->mouse_region_x) * 256 /
|
||||
(window->mouse_region_width <= 0 ? 1 : window->mouse_region_width);
|
||||
|
||||
window->mouse_loc_y = (uint16)
|
||||
((int) (event->y) - window->mouse_region_y) * SNES_HEIGHT_EXTENDED /
|
||||
((int) (event->y * scale_factor) - window->mouse_region_y) * (gui_config->overscan ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) /
|
||||
(window->mouse_region_height <= 0 ? 1 : window->mouse_region_height);
|
||||
|
||||
if (!window->config->pointer_is_visible)
|
||||
|
Loading…
Reference in New Issue
Block a user