libobs: Fix mouse button push to talk for linux

Fixes issue with mouse buttons 4 and 5 not working for push to talk
when using linux
This commit is contained in:
Kasin Sparks 2023-04-14 23:59:31 -04:00 committed by Jim
parent f0f704249f
commit b645ea6c5f

View file

@ -22,7 +22,7 @@
#include "obs-nix-x11.h" #include "obs-nix-x11.h"
#include <xcb/xcb.h> #include <xcb/xcb.h>
#if defined(XINPUT_FOUND) #if defined(XCB_XINPUT_FOUND)
#include <xcb/xinput.h> #include <xcb/xinput.h>
#endif #endif
#include <X11/Xlib.h> #include <X11/Xlib.h>
@ -94,7 +94,7 @@ struct obs_hotkeys_platform {
int num_keysyms; int num_keysyms;
int syms_per_code; int syms_per_code;
#if defined(XINPUT_FOUND) #if defined(XCB_XINPUT_FOUND)
bool pressed[XINPUT_MOUSE_LEN]; bool pressed[XINPUT_MOUSE_LEN];
bool update[XINPUT_MOUSE_LEN]; bool update[XINPUT_MOUSE_LEN];
bool button_pressed[XINPUT_MOUSE_LEN]; bool button_pressed[XINPUT_MOUSE_LEN];
@ -829,7 +829,7 @@ static inline xcb_window_t root_window(obs_hotkeys_platform_t *context,
return 0; return 0;
} }
#if defined(XINPUT_FOUND) #if defined(XCB_XINPUT_FOUND)
static inline void registerMouseEvents(struct obs_core_hotkeys *hotkeys) static inline void registerMouseEvents(struct obs_core_hotkeys *hotkeys)
{ {
obs_hotkeys_platform_t *context = hotkeys->platform_context; obs_hotkeys_platform_t *context = hotkeys->platform_context;
@ -860,7 +860,7 @@ static bool obs_nix_x11_hotkeys_platform_init(struct obs_core_hotkeys *hotkeys)
hotkeys->platform_context = bzalloc(sizeof(obs_hotkeys_platform_t)); hotkeys->platform_context = bzalloc(sizeof(obs_hotkeys_platform_t));
hotkeys->platform_context->display = display; hotkeys->platform_context->display = display;
#if defined(XINPUT_FOUND) #if defined(XCB_XINPUT_FOUND)
registerMouseEvents(hotkeys); registerMouseEvents(hotkeys);
#endif #endif
fill_base_keysyms(hotkeys); fill_base_keysyms(hotkeys);
@ -889,7 +889,7 @@ static bool mouse_button_pressed(xcb_connection_t *connection,
{ {
bool ret = false; bool ret = false;
#if defined(XINPUT_FOUND) #if defined(XCB_XINPUT_FOUND)
memset(context->pressed, 0, XINPUT_MOUSE_LEN); memset(context->pressed, 0, XINPUT_MOUSE_LEN);
memset(context->update, 0, XINPUT_MOUSE_LEN); memset(context->update, 0, XINPUT_MOUSE_LEN);