mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-09 00:31:31 +00:00
[client] cursor: improve Wayland hotspot alignment
Center the Wayland diagnostic cursor on its actual pointer hotspot and preserve it while cursor themes are reloaded for output-scale changes. Round fractional guest positions to the nearest logical pixel instead of biasing synchronization toward the top-left corner. Resynchronize the hardware pointer when a cursor shape changes its hotspot. Only perform the extra synchronization when the hotspot actually changes, and update the basic-mode projection at the same time.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "wayland.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
@@ -1027,5 +1028,5 @@ void waylandGuestPointerUpdated(double x, double y, double localX, double localY
|
||||
|
||||
MTRACE("guest warp guest=%.3f,%.3f local=%.3f,%.3f",
|
||||
x, y, localX, localY);
|
||||
waylandWarpPointer((int) localX, (int) localY, false);
|
||||
waylandWarpPointer((int) round(localX), (int) round(localY), false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user