From 1748ff0afaed33b4c2ec0d3e11ec7d92923c52e5 Mon Sep 17 00:00:00 2001 From: Matheus Date: Sat, 20 Apr 2024 15:48:13 -0300 Subject: [PATCH] xf86-input-mouse port: fix mouse device --- .../xf86-input-mouse/jinx-working-patch.patch | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/patches/xf86-input-mouse/jinx-working-patch.patch b/patches/xf86-input-mouse/jinx-working-patch.patch index 246601c6..86bdf03c 100644 --- a/patches/xf86-input-mouse/jinx-working-patch.patch +++ b/patches/xf86-input-mouse/jinx-working-patch.patch @@ -14,10 +14,10 @@ index 6c453cd..e27bdcb 100644 diff --git xf86-input-mouse-workdir/src/astral_mouse.c xf86-input-mouse-workdir/src/astral_mouse.c new file mode 100644 -index 0000000..49644ac +index 0000000..d3a4a60 --- /dev/null +++ xf86-input-mouse-workdir/src/astral_mouse.c -@@ -0,0 +1,126 @@ +@@ -0,0 +1,119 @@ +#ifdef HAVE_XORG_CONFIG_H +#include +#endif @@ -41,20 +41,18 @@ index 0000000..49644ac + +#include + -+ +#define MOUSE_FLAG_RB 1 +#define MOUSE_FLAG_MB 2 +#define MOUSE_FLAG_LB 4 +#define MOUSE_FLAG_B4 8 +#define MOUSE_FLAG_B5 16 + -+ +typedef struct { + int flags; + int x,y,z; +} mousepacket_t; + -+static void astralReadInput(InputInfoPtr pInfo){ ++static void astralReadInput(InputInfoPtr pInfo) { + MouseDevPtr mouse = pInfo->private; + mousepacket_t packet; + @@ -67,11 +65,9 @@ index 0000000..49644ac + + mouse->PostEvent(pInfo, b, packet.x, -packet.y, packet.z, 0); + } -+ +} + -+static Bool astralPreInit(InputInfoPtr pInfo, const char* proto, int flag){ -+ ++static Bool astralPreInit(InputInfoPtr pInfo, const char* proto, int flag) { + MouseDevPtr mouse; + + mouse = pInfo->private; @@ -89,14 +85,11 @@ index 0000000..49644ac + mouse->CommonOptions(pInfo); + pInfo->read_input = astralReadInput; + return true; -+ -+ +} + -+#define DEVPATH "/dev/mouse" ++#define DEVPATH "/dev/mouse0" + +static const char* getdevice(InputInfoPtr pInfo, const char* proto, int flag){ -+ + struct stat st; + + if(stat(DEVPATH, &st) == -1) @@ -105,10 +98,9 @@ index 0000000..49644ac + pInfo->options = xf86AddNewOption(pInfo->options, "Device", DEVPATH); + + return DEVPATH; -+ +} + -+static int interfacesupport(){ ++static int interfacesupport() { + return MSE_PS2; +} + @@ -116,25 +108,26 @@ index 0000000..49644ac + "AstralMouseDev", NULL +}; + -+static const char** protonames(){ ++static const char** protonames() { + return names; +} + -+static const char* defaultproto(){ ++static const char* defaultproto() { + return "AstralMouseDev"; +} + -+static Bool isdefault(const char *protocol){ ++static Bool isdefault(const char *protocol) { + return strcmp(protocol, defaultproto()) == 0; +} + -+OSMouseInfoPtr OSMouseInit(int flag){ ++OSMouseInfoPtr OSMouseInit(int flag) { + OSMouseInfoPtr p; + + p = calloc(sizeof(OSMouseInfoRec), 1); + + if (!p) -+ return NULL; ++ return NULL; ++ + p->SupportedInterfaces = interfacesupport; + p->BuiltinNames = protonames; + p->FindDevice = getdevice;