@@ -1416,10 +1416,10 @@ void WaylandThread::_wl_pointer_on_motion(void *data, struct wl_pointer *wl_poin
14161416 PointerData &pd = ss->pointer_data_buffer ;
14171417
14181418 // TODO: Scale only when sending the Wayland message.
1419- pd.position .x = wl_fixed_to_int (surface_x);
1420- pd.position .y = wl_fixed_to_int (surface_y);
1419+ pd.position .x = wl_fixed_to_double (surface_x);
1420+ pd.position .y = wl_fixed_to_double (surface_y);
14211421
1422- pd.position = scale_vector2i (pd. position , window_state_get_scale_factor (ws) );
1422+ pd.position *= window_state_get_scale_factor (ws);
14231423
14241424 pd.motion_time = time;
14251425}
@@ -1532,7 +1532,7 @@ void WaylandThread::_wl_pointer_on_frame(void *data, struct wl_pointer *wl_point
15321532 mm->set_position (pd.position );
15331533 mm->set_global_position (pd.position );
15341534
1535- Vector2i pos_delta = pd.position - old_pd.position ;
1535+ Vector2 pos_delta = pd.position - old_pd.position ;
15361536
15371537 if (old_pd.relative_motion_time != pd.relative_motion_time ) {
15381538 uint32_t time_delta = pd.relative_motion_time - old_pd.relative_motion_time ;
@@ -1649,7 +1649,7 @@ void WaylandThread::_wl_pointer_on_frame(void *data, struct wl_pointer *wl_point
16491649
16501650 // We have to set the last position pressed here as we can't take for
16511651 // granted what the individual events might have seen due to them not having
1652- // a garaunteed order.
1652+ // a guaranteed order.
16531653 if (mb->is_pressed ()) {
16541654 pd.last_pressed_position = pd.position ;
16551655 }
@@ -2388,9 +2388,9 @@ void WaylandThread::_wp_tablet_tool_on_motion(void *data, struct zwp_tablet_tool
23882388
23892389 double scale_factor = window_state_get_scale_factor (ws);
23902390
2391- td.position .x = wl_fixed_to_int (x);
2392- td.position .y = wl_fixed_to_int (y);
2393- td.position = scale_vector2i (td. position , scale_factor) ;
2391+ td.position .x = wl_fixed_to_double (x);
2392+ td.position .y = wl_fixed_to_double (y);
2393+ td.position *= scale_factor;
23942394
23952395 td.motion_time = OS::get_singleton ()->get_ticks_msec ();
23962396}
@@ -2520,7 +2520,7 @@ void WaylandThread::_wp_tablet_tool_on_frame(void *data, struct zwp_tablet_tool_
25202520 mm->set_relative (td.position - old_td.position );
25212521 mm->set_relative_screen_position (mm->get_relative ());
25222522
2523- Vector2i pos_delta = td.position - old_td.position ;
2523+ Vector2 pos_delta = td.position - old_td.position ;
25242524 uint32_t time_delta = td.motion_time - old_td.motion_time ;
25252525 mm->set_velocity ((Vector2)pos_delta / time_delta);
25262526
0 commit comments