======================================================================= Gnats 5929 (Hidden modal dialog) / Gnats 5989 Analysis, Phil, 12-14-2017 ======================================================================= Trace from sequence outlined by David in added info in Gnats 5898 (11-27-2017). Unfortunately, the final raising of the Run Control Dialog doesn't result in a focus change to that dialog. I'll have to find some other way of detecting this condition. (Slightly edited): -------------------------------- qAppl_focusChanged 'M' -- QApplication::activeModalWidget() 'P' -- QApplication::activePopupWidget() 'W' -- QApplication::activeWindow() qAppl_focusChanged [#1] "NULL" --> "Workspace" [W] qAppl_focusChanged [#2] "Workspace" --> "NULL" qAppl_focusChanged [#3] "NULL" --> "Workspace" [W] qAppl_focusChanged [#4] "Workspace" [W] --> "Workspace" [W] qAppl_focusChanged [#5] "Workspace" [W] --> "Workspace" [W] qAppl_focusChanged [#6] "Workspace" --> "" [W] qAppl_focusChanged [#7] "" --> "Workspace" [W] qAppl_focusChanged [#8] "Workspace" --> "QtRunControlDlg" [W] qAppl_focusChanged [#9] "QtRunControlDlg" [W] --> "QtRunControlDlg" [W] qAppl_focusChanged [#10] "QtRunControlDlg" [W] --> "QtRunControlDlg" [W] qAppl_focusChanged [#11] "QtRunControlDlg" [W] --> "QtRunControlDlg" [W] qAppl_focusChanged [#12] "QtRunControlDlg" --> "RwNoticeBox" [MW] qAppl_focusChanged [#13] "RwNoticeBox" [M] --> "NULL" qAppl_focusChanged [#14] "NULL" --> "RwNoticeBox" [MW] =========== C++ CODE: =========== // private slot void Workspace::qAppl_focusChanged (QWidget* priorWid, QWidget* curWid) { static const char* mname ("Workspace::qAppl_focusChanged"); static int callCnt (0); ++callCnt; if (callCnt == 1) { std::cout << mname << "\n" << " 'M' -- QApplication::activeModalWidget() \n" << " 'P' -- QApplication::activePopupWidget() \n" << " 'W' -- QApplication::activeWindow() \n" << std::endl; } QWidget* topPriorWid = priorWid ? priorWid->window() : NULL; QWidget* topCurWid = curWid ? curWid->window() : NULL; const QString priorWidStr = topPriorWid ? topPriorWid->objectName() : QString ("NULL"); const QString curWidStr = topCurWid ? topCurWid->objectName() : QString ("NULL"); const QWidget* activeModal = QApplication::activeModalWidget(); const QWidget* activePopup = QApplication::activePopupWidget(); const QWidget* activeWindow = QApplication::activeWindow(); QString priorFlags; if (topPriorWid) { if (topPriorWid == activeModal) priorFlags += QChar ('M'); if (topPriorWid == activePopup) priorFlags += QChar ('P'); if (topPriorWid == activeWindow) priorFlags += QChar ('W'); if (!priorFlags.isEmpty()) priorFlags = QString ("[%1]") .arg (priorFlags); } QString curFlags; if (topCurWid) { if (topCurWid == activeModal) curFlags += QChar ('M'); if (topCurWid == activePopup) curFlags += QChar ('P'); if (topCurWid == activeWindow) curFlags += QChar ('W'); if (!curFlags.isEmpty()) curFlags = QString ("[%1]") .arg (curFlags); } QString fmt ("\"%1\" %2 --> \"%3\" %4"); QString msg = fmt .arg (priorWidStr) .arg (priorFlags) .arg (curWidStr) .arg (curFlags); std::cout << mname << " [#" << callCnt << "] " << qPrintable (msg) << std::endl; }