From e7b358e174cd060fd50f26a4e6d35175af04e185 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 5 Sep 2024 15:24:50 +0200 Subject: [PATCH] 1 --- hw/xnest/Window.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c index 535f985ef..1897de02b 100644 --- a/hw/xnest/Window.c +++ b/hw/xnest/Window.c @@ -40,6 +40,8 @@ is" without express or implied warranty. #include "Color.h" #include "Events.h" #include "Args.h" +#include "Keyboard.h" +#include "Pointer.h" DevPrivateKeyRec xnestWindowPrivateKeyRec; @@ -161,6 +163,15 @@ xnestCreateWindow(WindowPtr pWin) if (!pWin->parent) /* only the root window will have the right colormap */ xnestSetInstalledColormapWindows(pWin->drawable.pScreen); + /* special handling for toplevel windows in rootless mode */ + if (xnestRootless && pWin->parent && !pWin->parent->parent) { + fprintf(stderr, "created toplevel window: catching input events\n"); + uint32_t event_mask = XNEST_KEYBOARD_EVENT_MASK | XNEST_POINTER_EVENT_MASK; + xcb_change_window_attributes(xnestUpstreamInfo.conn, + xnestWindow(pWin), + XCB_CW_EVENT_MASK, + &event_mask); + } return TRUE; }