libobs: Fix mouse button hotkeys on linux
The screen index returned from XDefaultScreen is 0-based, and we were decrementing it before the check to see if it had reached 0 rather than after, so in the default_screen function it would always end up getting either the wrong screen or no screen. When xcb_query_pointer and xcb_query_pointer_reply was called with no valid screen, it would fail with an error, thus making it so that the mouse buttons could not be properly captured as hotkeys.master
parent
f9eeb049fa
commit
3a5d7b1168
|
@ -682,7 +682,7 @@ static xcb_screen_t *default_screen(obs_hotkeys_platform_t *context,
|
|||
|
||||
iter = xcb_setup_roots_iterator(xcb_get_setup(connection));
|
||||
while (iter.rem) {
|
||||
if (--def_screen_idx == 0) {
|
||||
if (def_screen_idx-- == 0) {
|
||||
return iter.data;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue