提交 3a5d7b11 编写于 作者: J jp9000

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.
上级 f9eeb049
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册