VirtualBox

Changeset 30211 in vbox for trunk/src


Ignore:
Timestamp:
Jun 15, 2010 5:51:27 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt: 4977: Workaround to fix failed XGrabKeyboard under metacity when switching back to VM window.

File:
1 edited

Legend:

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

    r30114 r30211  
    25402540        {
    25412541            if (fCapture)
    2542                 XGrabKeyboard(QX11Info::display(), machineWindowWrapper()->machineWindow()->winId(), False, GrabModeAsync, GrabModeAsync, CurrentTime);
     2542            {
     2543                /* Keyboard grabbing can fail because of some keyboard shortcut is still grabbed by window manager.
     2544                 * We can't be sure this shortcut will be released at all, so we will retry to grab keyboard for 50 times,
     2545                 * and after we will just ignore that issue: */
     2546                int cTriesLeft = 50;
     2547                while (cTriesLeft && XGrabKeyboard(QX11Info::display(), machineWindowWrapper()->machineWindow()->winId(), False, GrabModeAsync, GrabModeAsync, CurrentTime)) { --cTriesLeft; }
     2548            }
    25432549            else
    25442550                XUngrabKeyboard(QX11Info::display(), CurrentTime);
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