VirtualBox

儲存庫 vbox 的更動 99437


忽略:
時間撮記:
2023-4-18 上午08:09:50 (19 月 以前)
作者:
vboxsync
訊息:

FE/Qt: bugref:10407. Make sure xcb calls in UIHostComboEditor are guarded by XServer availability check.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIHostComboEditor.cpp

    r98103 r99437  
    573573#elif defined(VBOX_WS_X11)
    574574    /* Initialize the X keyboard subsystem: */
    575     initMappedX11Keyboard(NativeWindowSubsystem::X11GetDisplay(), gEDataManager->remappedScanCodes());
     575    if (uiCommon().X11XServerAvailable())
     576        initMappedX11Keyboard(NativeWindowSubsystem::X11GetDisplay(), gEDataManager->remappedScanCodes());
    576577#endif /* VBOX_WS_X11 */
    577578}
     
    746747
    747748# elif defined(VBOX_WS_X11)
    748 
    749     /* Make sure it's generic XCB event: */
    750     if (eventType != "xcb_generic_event_t")
    751         return QLineEdit::nativeEvent(eventType, pMessage, pResult);
    752     xcb_generic_event_t *pEvent = static_cast<xcb_generic_event_t*>(pMessage);
    753 
    754     /* Check if some XCB event should be filtered out: */
    755     // Returning @c true means filtering-out,
    756     // Returning @c false means passing event to Qt.
    757     switch (pEvent->response_type & ~0x80)
    758     {
    759         /* Watch for key-events: */
    760         case XCB_KEY_PRESS:
    761         case XCB_KEY_RELEASE:
    762         {
    763             /* Parse key-event: */
    764             xcb_key_press_event_t *pKeyEvent = static_cast<xcb_key_press_event_t*>(pMessage);
    765             RT_GCC_NO_WARN_DEPRECATED_BEGIN
    766             const KeySym ks = ::XKeycodeToKeysym(NativeWindowSubsystem::X11GetDisplay(), pKeyEvent->detail, 0);
    767             RT_GCC_NO_WARN_DEPRECATED_END
    768             const int iKeySym = static_cast<int>(ks);
    769 
    770             /* Handle key-event: */
    771             return processKeyEvent(iKeySym, (pEvent->response_type & ~0x80) == XCB_KEY_PRESS);
    772         }
    773         default:
    774             break;
     749    if (uiCommon().X11XServerAvailable())
     750    {
     751        /* Make sure it's generic XCB event: */
     752        if (eventType != "xcb_generic_event_t")
     753            return QLineEdit::nativeEvent(eventType, pMessage, pResult);
     754        xcb_generic_event_t *pEvent = static_cast<xcb_generic_event_t*>(pMessage);
     755
     756        /* Check if some XCB event should be filtered out: */
     757        // Returning @c true means filtering-out,
     758        // Returning @c false means passing event to Qt.
     759        switch (pEvent->response_type & ~0x80)
     760        {
     761            /* Watch for key-events: */
     762            case XCB_KEY_PRESS:
     763            case XCB_KEY_RELEASE:
     764            {
     765                /* Parse key-event: */
     766                xcb_key_press_event_t *pKeyEvent = static_cast<xcb_key_press_event_t*>(pMessage);
     767                RT_GCC_NO_WARN_DEPRECATED_BEGIN
     768                const KeySym ks = ::XKeycodeToKeysym(NativeWindowSubsystem::X11GetDisplay(), pKeyEvent->detail, 0);
     769                RT_GCC_NO_WARN_DEPRECATED_END
     770                const int iKeySym = static_cast<int>(ks);
     771
     772                /* Handle key-event: */
     773                return processKeyEvent(iKeySym, (pEvent->response_type & ~0x80) == XCB_KEY_PRESS);
     774            }
     775            default:
     776                break;
     777        }
    775778    }
    776779
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette