[client] fix the warp logic to account for still pending warps to finish

As X11 is a server/client protocol, issuing commands such as
XWarpPointer do not happen immediately, as such we need to identify when
the warp is complete to know to null out the movement. To do this we
track each warp issued and look for it's completion in the event filter.
As some events come in via XInput2 we need to also make use of this
instead of just relying on MotionNotify, as such the support has been
implemented for XI_Motion events.
This commit is contained in:
Geoffrey McRae
2021-01-05 11:47:17 +11:00
parent 18e84c88a0
commit 6f99280fe3
2 changed files with 154 additions and 89 deletions

View File

@@ -25,6 +25,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include "dynamic/renderers.h"
#include "dynamic/clipboards.h"
#include "common/ivshmem.h"
#include "ll.h"
#include "spice/spice.h"
#include <lgmp/client.h>
@@ -156,8 +157,6 @@ struct KeybindHandle
enum WarpState
{
WARP_STATE_ON,
WARP_STATE_ACTIVE,
WARP_STATE_WIN_EXIT,
WARP_STATE_OFF
};
@@ -215,11 +214,9 @@ struct CursorState
int sens;
float sensX, sensY;
/* the mouse warp state and target */
/* the mouse warp state and queue */
enum WarpState warpState;
bool warpExit;
unsigned long warpSerial;
SDL_Point warpTo;
struct ll * warpList;
/* the guest's cursor position */
struct CursorInfo guest;