Changeset 92848 in vbox
- Timestamp:
- Dec 9, 2021 1:48:59 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 148777
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
r91066 r92848 585 585 } 586 586 587 void UIMiniToolBar::sltCheckWindowActivationSanity() 588 { 589 /* Do nothing if other window is already active: */ 590 if (QGuiApplication::focusWindow() != windowHandle()) 591 return; 592 593 /* We can't touch window activation if have modal or popup 594 * window opened, otherwise internal Qt state get flawed: */ 595 if ( QApplication::activeModalWidget() 596 || QApplication::activePopupWidget()) 597 { 598 /* But we should recheck the state in let's say 300ms: */ 599 QTimer::singleShot(300, this, SLOT(sltCheckWindowActivationSanity())); 600 return; 601 } 602 603 /* Notify listener about we have stole window activation: */ 604 emit sigNotifyAboutWindowActivationStolen(); 605 } 606 587 607 void UIMiniToolBar::sltHide() 588 608 { … … 999 1019 { 1000 1020 #if defined(VBOX_WS_WIN) 1001 emit sigNotifyAboutWindowActivationStolen(); 1021 /* Just call the method asynchronously, after possible popups opened: */ 1022 QTimer::singleShot(0, this, SLOT(sltCheckWindowActivationSanity())); 1002 1023 #elif defined(VBOX_WS_X11) 1003 1024 switch (uiCommon().typeOfWindowManager()) … … 1011 1032 // In fact, Qt is not become aware of actual window activation later, 1012 1033 // so we are going to return window activation in let's say 100ms. 1013 QTimer::singleShot(100, this, SLOT(slt NotifyAboutWindowActivationStolen()));1034 QTimer::singleShot(100, this, SLOT(sltCheckWindowActivationSanity())); 1014 1035 break; 1015 1036 } 1016 1037 default: 1017 1038 { 1018 emit sigNotifyAboutWindowActivationStolen(); 1039 /* Just call the method asynchronously, after possible popups opened: */ 1040 QTimer::singleShot(0, this, SLOT(sltCheckWindowActivationSanity())); 1019 1041 break; 1020 1042 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h
r88635 r92848 120 120 void sltHoverLeave(); 121 121 122 /** Notifies listeners about we stole window activation. */123 void slt NotifyAboutWindowActivationStolen() { emit sigNotifyAboutWindowActivationStolen(); }122 /** Check whether we still have window activation token. */ 123 void sltCheckWindowActivationSanity(); 124 124 125 125 /** Hides window. */
Note:
See TracChangeset
for help on using the changeset viewer.