VirtualBox

Ignore:
Timestamp:
Aug 4, 2014 1:59:14 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: suppress unwanted FocusIn events on X11 hosts which could cause focus cycles between machine windows.

File:
1 edited

Legend:

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

    r52243 r52266  
    203203                 * and after we will just ignore that issue: */
    204204                int cTriesLeft = 50;
     205                XEvent dummy;
    205206                while (cTriesLeft && XGrabKeyboard(QX11Info::display(), m_windows[m_iKeyboardCaptureViewIndex]->winId(), False, GrabModeAsync, GrabModeAsync, CurrentTime)) { --cTriesLeft; }
     207                /* If the grab succeeds, X will insert a FocusIn event for this
     208                 * window into the event queue.  If we have two windows they can
     209                 * end up in an endless cycle of passing the focus back and
     210                 * forward as there is always a pending FocusIn for each, and we
     211                 * drop and re-take the grab each time the focus changes.  So we
     212                 * remove the event again before Qt can see it. */
     213                if (cTriesLeft > 0)
     214                    XCheckTypedWindowEvent(QX11Info::display(),
     215                            m_windows[m_iKeyboardCaptureViewIndex]->winId(),
     216                            XFocusIn, &dummy);
    206217                break;
    207218            }
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