From 2aaf6b8380e238bd993ddd19585fa392771824ec Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 4 Jan 2025 02:50:48 +0100 Subject: Fix some games receiving mouse input on wayland --- src/Overlay.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Overlay.cpp b/src/Overlay.cpp index d17c4cc..eb4ea4b 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -47,7 +47,12 @@ namespace gsr { } static bool is_cursor_hovering_application_wayland(Display *dpy) { - return get_focused_window(dpy, WindowCaptureType::CURSOR) == 0; + Window root_window = None; + Window window = None; + int dummy_i; + unsigned int dummy_u; + XQueryPointer(dpy, DefaultRootWindow(dpy), &root_window, &window, &dummy_i, &dummy_i, &dummy_i, &dummy_i, &dummy_u); + return window == None; } static mgl::Texture texture_from_ximage(XImage *img) { -- cgit v1.2.3