[client] rename warpMouse to warpPointer

This is more truthful in what it does; the pointer may be backed by a
non-mouse device.
This commit is contained in:
Tudor Brindus 2021-01-16 13:10:52 -05:00 committed by Geoffrey McRae
parent d926319230
commit f1033fa4bb
5 changed files with 13 additions and 13 deletions

View File

@ -131,7 +131,7 @@ static void sdlUngrabKeyboard(void)
sdl.keyboardGrabbed = false; sdl.keyboardGrabbed = false;
} }
static void sdlWarpMouse(int x, int y, bool exiting) static void sdlWarpPointer(int x, int y, bool exiting)
{ {
if (sdl.exiting) if (sdl.exiting)
return; return;
@ -160,7 +160,7 @@ struct LG_DisplayServerOps LGDS_SDL =
.ungrabPointer = sdlUngrabPointer, .ungrabPointer = sdlUngrabPointer,
.grabKeyboard = sdlGrabKeyboard, .grabKeyboard = sdlGrabKeyboard,
.ungrabKeyboard = sdlUngrabKeyboard, .ungrabKeyboard = sdlUngrabKeyboard,
.warpMouse = sdlWarpMouse, .warpPointer = sdlWarpPointer,
/* SDL does not have clipboard support */ /* SDL does not have clipboard support */
.cbInit = NULL, .cbInit = NULL,

View File

@ -386,7 +386,7 @@ static void waylandUngrabKeyboard(void)
} }
} }
static void waylandWarpMouse(int x, int y, bool exiting) static void waylandWarpPointer(int x, int y, bool exiting)
{ {
// This is an unsupported operation on Wayland. // This is an unsupported operation on Wayland.
} }
@ -773,7 +773,7 @@ struct LG_DisplayServerOps LGDS_Wayland =
.ungrabPointer = waylandUngrabPointer, .ungrabPointer = waylandUngrabPointer,
.grabKeyboard = waylandGrabKeyboard, .grabKeyboard = waylandGrabKeyboard,
.ungrabKeyboard = waylandUngrabKeyboard, .ungrabKeyboard = waylandUngrabKeyboard,
.warpMouse = waylandWarpMouse, .warpPointer = waylandWarpPointer,
.cbInit = waylandCBInit, .cbInit = waylandCBInit,
.cbNotice = waylandCBNotice, .cbNotice = waylandCBNotice,

View File

@ -433,7 +433,7 @@ static void x11UngrabKeyboard(void)
x11.keyboardGrabbed = false; x11.keyboardGrabbed = false;
} }
static void x11WarpMouse(int x, int y, bool exiting) static void x11WarpPointer(int x, int y, bool exiting)
{ {
XWarpPointer( XWarpPointer(
x11.display, x11.display,
@ -785,7 +785,7 @@ struct LG_DisplayServerOps LGDS_X11 =
.ungrabPointer = x11UngrabPointer, .ungrabPointer = x11UngrabPointer,
.grabKeyboard = x11GrabKeyboard, .grabKeyboard = x11GrabKeyboard,
.ungrabKeyboard = x11UngrabKeyboard, .ungrabKeyboard = x11UngrabKeyboard,
.warpMouse = x11WarpMouse, .warpPointer = x11WarpPointer,
.cbInit = x11CBInit, .cbInit = x11CBInit,
.cbNotice = x11CBNotice, .cbNotice = x11CBNotice,

View File

@ -93,7 +93,7 @@ struct LG_DisplayServerOps
void (*ungrabKeyboard)(); void (*ungrabKeyboard)();
//exiting = true if the warp is to leave the window //exiting = true if the warp is to leave the window
void (*warpMouse)(int x, int y, bool exiting); void (*warpPointer)(int x, int y, bool exiting);
/* clipboard support */ /* clipboard support */
bool (* cbInit)(void); bool (* cbInit)(void);

View File

@ -861,7 +861,7 @@ void spiceClipboardRequest(const SpiceDataType type)
g_state.ds->cbRequest(spice_type_to_clipboard_type(type)); g_state.ds->cbRequest(spice_type_to_clipboard_type(type));
} }
static void warpMouse(int x, int y, bool exiting) static void warpPointer(int x, int y, bool exiting)
{ {
if (g_cursor.warpState == WARP_STATE_OFF) if (g_cursor.warpState == WARP_STATE_OFF)
return; return;
@ -872,7 +872,7 @@ static void warpMouse(int x, int y, bool exiting)
if (g_cursor.pos.x == x && g_cursor.pos.y == y) if (g_cursor.pos.x == x && g_cursor.pos.y == y)
return; return;
g_state.ds->warpMouse(x, y, exiting); g_state.ds->warpPointer(x, y, exiting);
} }
static bool isValidCursorLocation(int x, int y) static bool isValidCursorLocation(int x, int y)
@ -1069,7 +1069,7 @@ void app_handleMouseNormal(double ex, double ey)
/* ungrab the pointer and move the local cursor to the exit point */ /* ungrab the pointer and move the local cursor to the exit point */
g_state.ds->ungrabPointer(); g_state.ds->ungrabPointer();
warpMouse(tx, ty, true); warpPointer(tx, ty, true);
return; return;
} }
} }
@ -1089,7 +1089,7 @@ void app_handleMouseNormal(double ex, double ey)
{ {
g_cursor.delta.x = 0; g_cursor.delta.x = 0;
g_cursor.delta.y = 0; g_cursor.delta.y = 0;
warpMouse(g_state.windowCX, g_state.windowCY, false); warpPointer(g_state.windowCX, g_state.windowCY, false);
} }
g_cursor.guest.x = g_state.srcSize.x / 2; g_cursor.guest.x = g_state.srcSize.x / 2;
@ -1280,7 +1280,7 @@ int eventFilter(void * userdata, SDL_Event * event)
struct DoublePoint local; struct DoublePoint local;
guestCurToLocal(&local); guestCurToLocal(&local);
warpMouse(round(local.x), round(local.y), false); warpPointer(round(local.x), round(local.y), false);
break; break;
} }
} }
@ -1707,7 +1707,7 @@ static int lg_run(void)
SET_FALLBACK(eventFilter); SET_FALLBACK(eventFilter);
SET_FALLBACK(grabPointer); SET_FALLBACK(grabPointer);
SET_FALLBACK(ungrabKeyboard); SET_FALLBACK(ungrabKeyboard);
SET_FALLBACK(warpMouse); SET_FALLBACK(warpPointer);
SET_FALLBACK(cbInit); SET_FALLBACK(cbInit);
SET_FALLBACK(cbNotice); SET_FALLBACK(cbNotice);
SET_FALLBACK(cbRelease); SET_FALLBACK(cbRelease);