From 65ce2b1c6570bb6baa14f7c61d0d6beebde09c78 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 12 Aug 2024 14:54:39 +0200 Subject: [PATCH] (!1654) Xnest: replace XSelectInput() by xcb_change_window_attributes() Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xnest/Display.c | 2 +- hw/xnest/Display.h | 2 +- hw/xnest/Keyboard.c | 10 ++++++++-- hw/xnest/Pointer.c | 10 ++++++++-- hw/xnest/Screen.c | 6 ++++-- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c index 5bf6e4aba..10fef44db 100644 --- a/hw/xnest/Display.c +++ b/hw/xnest/Display.c @@ -51,7 +51,7 @@ Drawable xnestDefaultDrawables[MAXDEPTH + 1]; Pixmap xnestIconBitmap; Pixmap xnestScreenSaverPixmap; uint32_t xnestBitmapGC; -unsigned long xnestEventMask; +uint32_t xnestEventMask; static int _X_NORETURN x_io_error_handler(Display * dpy) diff --git a/hw/xnest/Display.h b/hw/xnest/Display.h index 38cbe221b..a972c84b5 100644 --- a/hw/xnest/Display.h +++ b/hw/xnest/Display.h @@ -33,7 +33,7 @@ extern Drawable xnestDefaultDrawables[MAXDEPTH + 1]; extern Pixmap xnestIconBitmap; extern Pixmap xnestScreenSaverPixmap; extern uint32_t xnestBitmapGC; -extern unsigned long xnestEventMask; +extern uint32_t xnestEventMask; void xnestOpenDisplay(int argc, char *argv[]); void xnestCloseDisplay(void); diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c index 597442163..3ac7f779b 100644 --- a/hw/xnest/Keyboard.c +++ b/hw/xnest/Keyboard.c @@ -201,12 +201,18 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) case DEVICE_ON: xnestEventMask |= XNEST_KEYBOARD_EVENT_MASK; for (i = 0; i < xnestNumScreens; i++) - XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask); + xcb_change_window_attributes(xnestUpstreamInfo.conn, + xnestDefaultWindows[i], + XCB_CW_EVENT_MASK, + &xnestEventMask); break; case DEVICE_OFF: xnestEventMask &= ~XNEST_KEYBOARD_EVENT_MASK; for (i = 0; i < xnestNumScreens; i++) - XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask); + xcb_change_window_attributes(xnestUpstreamInfo.conn, + xnestDefaultWindows[i], + XCB_CW_EVENT_MASK, + &xnestEventMask); break; case DEVICE_CLOSE: break; diff --git a/hw/xnest/Pointer.c b/hw/xnest/Pointer.c index 5604b8251..5978332d3 100644 --- a/hw/xnest/Pointer.c +++ b/hw/xnest/Pointer.c @@ -87,12 +87,18 @@ xnestPointerProc(DeviceIntPtr pDev, int onoff) case DEVICE_ON: xnestEventMask |= XNEST_POINTER_EVENT_MASK; for (i = 0; i < xnestNumScreens; i++) - XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask); + xcb_change_window_attributes(xnestUpstreamInfo.conn, + xnestDefaultWindows[i], + XCB_CW_EVENT_MASK, + &xnestEventMask); break; case DEVICE_OFF: xnestEventMask &= ~XNEST_POINTER_EVENT_MASK; for (i = 0; i < xnestNumScreens; i++) - XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask); + xcb_change_window_attributes(xnestUpstreamInfo.conn, + xnestDefaultWindows[i], + XCB_CW_EVENT_MASK, + &xnestEventMask); break; case DEVICE_CLOSE: break; diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index f99fae0ee..0ae16a4a3 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -383,8 +383,10 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) if (xnestParentWindow != 0) { xnestDefaultWindows[pScreen->myNum] = xnestParentWindow; - XSelectInput(xnestDisplay, xnestDefaultWindows[pScreen->myNum], - xnestEventMask); + xcb_change_window_attributes(xnestUpstreamInfo.conn, + xnestDefaultWindows[pScreen->myNum], + XCB_CW_EVENT_MASK, + &xnestEventMask); } else { xnestDefaultWindows[pScreen->myNum] = xcb_generate_id(xnestUpstreamInfo.conn);