VirtualBox

Changeset 92849 in vbox


Ignore:
Timestamp:
Dec 9, 2021 2:41:32 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10166: An X11 fix for r148777; Linux as usually async in events delivery.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r92848 r92849  
    587587void UIMiniToolBar::sltCheckWindowActivationSanity()
    588588{
    589     /* Do nothing if other window is already active: */
    590     if (QGuiApplication::focusWindow() != windowHandle())
     589    /* Do nothing if parent window is already active: */
     590    if (   m_pParent
     591        && QGuiApplication::focusWindow() == m_pParent->windowHandle())
    591592        return;
    592593
     
    10221023        QTimer::singleShot(0, this, SLOT(sltCheckWindowActivationSanity()));
    10231024#elif defined(VBOX_WS_X11)
    1024         switch (uiCommon().typeOfWindowManager())
    1025         {
    1026             case X11WMType_GNOMEShell:
    1027             case X11WMType_Mutter:
    1028             {
    1029                 // WORKAROUND:
    1030                 // Under certain WMs we can receive stolen activation event too early,
    1031                 // returning activation to initial source immediately makes no sense.
    1032                 // In fact, Qt is not become aware of actual window activation later,
    1033                 // so we are going to return window activation in let's say 100ms.
    1034                 QTimer::singleShot(100, this, SLOT(sltCheckWindowActivationSanity()));
    1035                 break;
    1036             }
    1037             default:
    1038             {
    1039                 /* Just call the method asynchronously, after possible popups opened: */
    1040                 QTimer::singleShot(0, this, SLOT(sltCheckWindowActivationSanity()));
    1041                 break;
    1042             }
    1043         }
     1025        // WORKAROUND:
     1026        // Under certain WMs we can receive stolen activation event too early,
     1027        // returning activation to initial source immediately makes no sense.
     1028        // In fact, Qt is not become aware of actual window activation later,
     1029        // so we are going to check for window activation in let's say 100ms.
     1030        QTimer::singleShot(100, this, SLOT(sltCheckWindowActivationSanity()));
    10441031#endif /* VBOX_WS_X11 */
    10451032    }
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