diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-08-16 20:37:09 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-08-16 20:37:09 +0300 |
commit | b7d91087099e4b69d70c0271fbeae19368d485d4 (patch) | |
tree | f46b62227cfeccf32b72f6aeb45c17cc7a933505 /src/plugins/platforms/xcb/qxcbconnection.cpp | |
parent | 231d3670981a33ec42b91ad1cb33c1fc50551066 (diff) | |
parent | bbfbb18df18658e8ceec4bc04bd2cdf59f6a35ed (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.6' into tqtc/lts-5.15-opensource
Change-Id: Ia9164a17d80376f0a3ab9752c4a9f4dd2f0bd3d9
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 9abdae6a7c..34fbc0b10b 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -221,6 +221,12 @@ void QXcbConnection::printXcbEvent(const QLoggingCategory &log, const char *mess } #define CASE_PRINT_AND_RETURN(name) case name : PRINT_AND_RETURN(#name); +#define XI_PRINT_AND_RETURN(name) { \ + qCDebug(log, "%s | XInput Event(%s) | sequence: %d", message, name, sequence); \ + return; \ +} +#define XI_CASE_PRINT_AND_RETURN(name) case name : XI_PRINT_AND_RETURN(#name); + switch (response_type) { CASE_PRINT_AND_RETURN( XCB_KEY_PRESS ); CASE_PRINT_AND_RETURN( XCB_KEY_RELEASE ); @@ -255,7 +261,44 @@ void QXcbConnection::printXcbEvent(const QLoggingCategory &log, const char *mess CASE_PRINT_AND_RETURN( XCB_COLORMAP_NOTIFY ); CASE_PRINT_AND_RETURN( XCB_CLIENT_MESSAGE ); CASE_PRINT_AND_RETURN( XCB_MAPPING_NOTIFY ); - CASE_PRINT_AND_RETURN( XCB_GE_GENERIC ); + case XCB_GE_GENERIC: { + if (hasXInput2() && isXIEvent(event)) { + auto *xiDeviceEvent = reinterpret_cast<const xcb_input_button_press_event_t*>(event); // qt_xcb_input_device_event_t + switch (xiDeviceEvent->event_type) { + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_KEY_PRESS ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_KEY_RELEASE ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_BUTTON_PRESS ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_BUTTON_RELEASE ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_MOTION ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_ENTER ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_LEAVE ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_FOCUS_IN ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_FOCUS_OUT ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_HIERARCHY ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_PROPERTY ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_RAW_KEY_PRESS ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_RAW_KEY_RELEASE ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_RAW_BUTTON_PRESS ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_RAW_BUTTON_RELEASE ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_RAW_MOTION ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_TOUCH_BEGIN ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_TOUCH_UPDATE ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_TOUCH_END ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_TOUCH_OWNERSHIP ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_RAW_TOUCH_BEGIN ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_RAW_TOUCH_UPDATE ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_RAW_TOUCH_END ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_BARRIER_HIT ); + XI_CASE_PRINT_AND_RETURN( XCB_INPUT_BARRIER_LEAVE ); + default: + qCDebug(log, "%s | XInput Event(other type) | sequence: %d", message, sequence); + return; + } + } else { + qCDebug(log, "%s | %s(%d) | sequence: %d", message, "XCB_GE_GENERIC", response_type, sequence); + return; + } + } } // XFixes if (isXFixesType(response_type, XCB_XFIXES_SELECTION_NOTIFY)) |