VirtualBox

Ignore:
Timestamp:
Jun 7, 2011 8:37:25 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72136
Message:

FE/Qt: remove the grab-the-keyboard-50-times hack

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r37365 r37366  
    191191            case UIVisualStateType_Seamless:
    192192            {
    193                 /* Keyboard grabbing can fail because of some keyboard shortcut is still grabbed by window manager.
    194                  * We can't be sure this shortcut will be released at all, so we will retry to grab keyboard for 50 times,
    195                  * and after we will just ignore that issue: */
    196                 int cTriesLeft = 50;
    197                 while (cTriesLeft && XGrabKeyboard(QX11Info::display(), m_windows[m_iKeyboardCaptureViewIndex]->machineWindow()->winId(), False, GrabModeAsync, GrabModeAsync, CurrentTime)) { --cTriesLeft; }
     193                /* Keyboard grabbing can fail temporarily because some keyboard shortcut is still grabbed by window manager. */
     194                if (XGrabKeyboard(QX11Info::display(), m_windows[m_iKeyboardCaptureViewIndex]->machineWindow()->winId(), False, GrabModeAsync, GrabModeAsync, CurrentTime))
     195                    m_fIsKeyboardCaptured = false;
    198196                break;
    199197            }
     
    212210
    213211        /* Notify all the listeners: */
    214         emit keyboardStateChanged(keyboardState());
     212        if (m_fIsKeyboardCaptured)
     213            emit keyboardStateChanged(keyboardState());
    215214    }
    216215}
Note: See TracChangeset for help on using the changeset viewer.

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