Summary: | Cannot interact with a modal QFontDialog | ||
---|---|---|---|
Product: | [Plasma] plasma-integration | Reporter: | Zhora Zmeikin <rs5334819> |
Component: | general | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | cherifkahsum, eric1, funck.r, kde, nate, nicolas.fella, noahadvs |
Priority: | HI | Keywords: | qt6 |
Version: | 5.90.0 | ||
Target Milestone: | --- | ||
Platform: | Neon | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-integration/-/commit/cbc0e44bafde499618df85625b1966ba310a0094 | Version Fixed In: | 6.0.4 |
Attachments: | A window that cannot be interacted with |
Can reproduce. Apparently the dialog is usable while Spectacle is being inspected with GammaRay, but not otherwise. The code involving the font dialog has not been touched in a while, so I'm inclined to believe that the bug comes from somewhere outside of Spectacle, but I'm not sure where. The way font strings are serialized in config files changes between Qt5 and Qt6, which may be related. (In reply to Nate Graham from comment #3) > The way font strings are serialized in config files changes between Qt5 and > Qt6, which may be related. The bug still happens even if there are no font settings in the config file. Also, this is a recent change even if you were already using the Qt6-only version of spectacle. it has something to do with the modality of the dialog in https://invent.kde.org/plasma/plasma-integration/-/blob/master/qt6/src/platformtheme/kdeplatformfontdialoghelper.cpp?ref_type=heads#L43 we get Qt::WindowModal and set that on the QFontDialog. When I change that to ApplicationModal it works. Or if I in https://invent.kde.org/graphics/spectacle/-/blob/master/src/Gui/SpectacleWindow.cpp#L345 replace open() with show() it also works. I don't fully understand it though I get the bug with QFontDialog under the following conditions: ``` // Calling QDialog::open(). // This sets the modality to Qt::WindowModal via QWidget::setWindowModality() and then calls QWidget::show(). // QWidget::setWindowModality() sets the specific type of modality and also sets the Qt::WA_ShowModal attribute. // When Qt::WA_ShowModal is set, the modality is set to Qt::ApplicationModal if it is currently set to Qt::NonModal // and otherwise keeps the current modality. // If the widget has the attribute Qt::WA_WState_Created, the current modality is applied to the widget's windowHandle. dialog->open(); // Setting Qt::ApplicationModal and calling QWidget::show(). dialog->setWindowModality(Qt::ApplicationModal); dialog->show(); // Setting the dialog as modal via QDialog::setModal() and calling QWidget::show(). // This has the same behavior as setting the modality to Qt::ApplicationModal. dialog->setModal(true); dialog->show(); ``` If I only call QWidget::show(), the QFontDialog can be used, but the dialog is non-modal. It seems that Qt Designer (the Qt Widgets one) also has this problem with modal font dialogs. Git commit 7cb638347fd0c906eb0ddfdc8f1954dd8089be4b by Noah Davis. Committed on 30/01/2024 at 01:32. Pushed by ndavis into branch 'master'. Workaround modal QFontDialogs being unusable M +5 -1 src/Gui/SpectacleWindow.cpp https://invent.kde.org/graphics/spectacle/-/commit/7cb638347fd0c906eb0ddfdc8f1954dd8089be4b Git commit 9bda6f78610094b5b8300682c9bbe38089209fa3 by Noah Davis. Committed on 30/01/2024 at 01:33. Pushed by ndavis into branch 'release/24.02'. Workaround modal QFontDialogs being unusable (cherry picked from commit 7cb638347fd0c906eb0ddfdc8f1954dd8089be4b) M +5 -1 src/Gui/SpectacleWindow.cpp https://invent.kde.org/graphics/spectacle/-/commit/9bda6f78610094b5b8300682c9bbe38089209fa3 *** Bug 483872 has been marked as a duplicate of this bug. *** A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-integration/-/merge_requests/141 *** Bug 485272 has been marked as a duplicate of this bug. *** Git commit 9419f251b6633d9c440bfc662c80e75eeee3404c by Nicolas Fella. Committed on 10/04/2024 at 17:15. Pushed by nicolasfella into branch 'master'. Revert "Implement Font dialogs" This breaks interacting with modal font dialogs. Revert this because ugly QML font dialogs are better than broken ones in most apps This reverts commit 53cfae46b00f7844718bb75c469cfcf6efcb070d. M +0 -1 qt6/autotests/CMakeLists.txt M +0 -1 qt6/src/platformtheme/CMakeLists.txt D +0 -64 qt6/src/platformtheme/kdeplatformfontdialoghelper.cpp D +0 -32 qt6/src/platformtheme/kdeplatformfontdialoghelper.h M +1 -3 qt6/src/platformtheme/kdeplatformtheme.cpp https://invent.kde.org/plasma/plasma-integration/-/commit/9419f251b6633d9c440bfc662c80e75eeee3404c Git commit cbc0e44bafde499618df85625b1966ba310a0094 by Nicolas Fella. Committed on 10/04/2024 at 17:26. Pushed by nicolasfella into branch 'Plasma/6.0'. Revert "Implement Font dialogs" This breaks interacting with modal font dialogs. Revert this because ugly QML font dialogs are better than broken ones in most apps This reverts commit 53cfae46b00f7844718bb75c469cfcf6efcb070d. (cherry picked from commit 9419f251b6633d9c440bfc662c80e75eeee3404c) M +0 -1 qt6/autotests/CMakeLists.txt M +0 -1 qt6/src/platformtheme/CMakeLists.txt D +0 -64 qt6/src/platformtheme/kdeplatformfontdialoghelper.cpp D +0 -32 qt6/src/platformtheme/kdeplatformfontdialoghelper.h M +1 -3 qt6/src/platformtheme/kdeplatformtheme.cpp https://invent.kde.org/plasma/plasma-integration/-/commit/cbc0e44bafde499618df85625b1966ba310a0094 |
Created attachment 163937 [details] A window that cannot be interacted with STEPS TO REPRODUCE 1. Take a screenshot using Spectacle 2. Click "Show annotation tools". 3. Navigate to the Text tool. 4. Try changing the font. And you'll notice that the font selection window just hangs. You can't click on it, you can only close it. SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE Neon (Unstable), Wayland KDE Plasma Version: 5.90.0 KDE Frameworks Version: 5.246.0 Qt Version: 6.6.0