Open detiam opened 7 months ago
Hi, Not much I can do if there is no reproductible issue. If you encounter an unknown event, I don't see what could be done here. Maybe you are using Wayland and XWayland ?
Must investigate how the game actually gets its events, but spamming the game with events makes the overlay receive events. Like, hold SHIFT, then press a lot of your keyboard keys while pressing the open overlay key, then it will sometimes open.
I guess the game use something else than XEventsQueued or XPending to get its events. InGameOverlay hooks only XEventsQueued and XPending, the game probably use one of thoses: XPeekEvent, XPending, XEventsQueued, XNextEvent
Hi,
Not much I can do if there is no reproductible issue. If you encounter an unknown event, I don't see what could be done here. Maybe you are using Wayland and XWayland ?
I'm on kde5, pure x11 session on Arch Linux
extra/libx11
1.8.8-2
extra/xorg-server
21.1.11-2
Must investigate how the game actually gets its events, but spamming the game with events makes the overlay receive events. Like, hold SHIFT, then press a lot of your keyboard keys while pressing the open overlay key, then it will sometimes open.
I guess the game use something else than XEventsQueued or XPending to get its events. InGameOverlay hooks only XEventsQueued and XPending, the game probably use one of thoses: XPeekEvent, XPending, XEventsQueued, XNextEvent
@_@
Mystery solved, this game doesn't use libX11, it uses libxcb:
[00:54:57.329](6135)[debug] - Myxcb_poll_for_event{88} - xcb_poll_for_event BEGIN
[00:54:57.329](6135)[debug] - Myxcb_poll_for_event{90} - xcb_poll_for_event END
[00:54:57.329](6135)[debug] - MyXPending{393} - XPending(0x67998e0) -> 1
[00:54:57.329](6135)[info] - _CheckForOverlay{293} - Event type: 3
[00:54:57.329](6135)[debug] - Myxcb_poll_for_event{88} - xcb_poll_for_event BEGIN
[00:54:57.329](6135)[debug] - Myxcb_poll_for_event{90} - xcb_poll_for_event END
I need a new driver for libxcb alongside libX11: https://github.com/Nemirtingas/ingame_overlay/issues/23
Anyway, developpers should stop doing strange stuff. Why would you use both libX11 AND libxcb for your X server events ?
Mystery solved, this game doesn't use libX11, it uses libxcb:
[00:54:57.329](6135)[debug] - Myxcb_poll_for_event{88} - xcb_poll_for_event BEGIN [00:54:57.329](6135)[debug] - Myxcb_poll_for_event{90} - xcb_poll_for_event END [00:54:57.329](6135)[debug] - MyXPending{393} - XPending(0x67998e0) -> 1 [00:54:57.329](6135)[info] - _CheckForOverlay{293} - Event type: 3 [00:54:57.329](6135)[debug] - Myxcb_poll_for_event{88} - xcb_poll_for_event BEGIN [00:54:57.329](6135)[debug] - Myxcb_poll_for_event{90} - xcb_poll_for_event END
I need a new driver for libxcb alongside libX11: #23
Anyway, developpers should stop doing strange stuff. Why would you use both libX11 AND libxcb for your X server events ?
Found a new game that influenced by this issue and have exactly same behavior, Factorio.
Dig it a little and find both of them load /usr/lib/libX11-xcb.so
, wondering if this is related, and using both libX11
and libxcb
seems to be officially supported.
I agree the fact that using both libraries is valid, but what is incorrect is to use both libraries to get the X server events. That makes conflicts like in Stellaris when the X event queue gets clogged, both xcb and libX return events
Tested the new commit, it give me this error undefined symbol: xcb_key_symbols_alloc
and crash for both Factorio and Stellaris.
If I use env var LD_PRELOAD
to preload my so, it will print error _StartXcbHook{136} - Failed to hook xcb_query_pointer_reply
and when I press anything, game crash like above.
The xcb hook branch is absolutely not ready. I didn't encounter any of your issue, this is surely because you didn't link the correct xcb libraries.
Right now the issue is that I don't know how to get the same behavior with xcb as X11 hooks, it always hangs.
This is similar to #6, hooks to the game Stellaris.
I added the line
to line 267 of X11Hook.cpp, launch game and keeps typing the key combination whole time, get the result:
When the game just launched, I can get the normal 2 (KeyPress), 3 (KeyRelease) and 6 (MotionNotify) event and open overlay, then it changes to these unknown 85 events and key press not respond anymore.