Only allow one instance of non-modal layer properties dialog
This patch was mainly created to fix the multiple dialogs issue. After that, I noticed other unrelated problems and tried to fix them as well.
Uses the lower level destroy() signal to handle the case of the dialog getting destroyed, e.g. by closing the document.
This patch also unifies the handling of generator dialog, to avoid a class of bugs where branches of code can diverge. This fixes issues with the generator layer dialog:
- not getting focus on open
- not getting destroyed on canvas closed
- missing some tweaks for Android
NOTE! While testing in master, I noticed a regression in fill layer. Color doesn't show and it can crash. To confirm my patch is not to blame, I cherry-picked and tested on top of 5.2.3 as well. I will try to find that regression separately.
NOTE2 If you don't like the refactoring, I can go back to a simpler version where the changes are applied in two places for generator layers and regular layers.
Test Plan
Main thing is now that you hold down the F3 key, it won't spawn the dialogs indefinitely.
There are other cases to try, selecting multiple layers, deleting them, closing the document, testing multiple views, multiple windows, I tried all of that and didn't run into any crashes or errors.
Formalities Checklist
-
I confirmed this builds. -
I confirmed Krita ran and the relevant functions work. -
I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) -
I made sure my commits build individually and have good descriptions as per KDE guidelines. -
I made sure my code conforms to the standards set in the HACKING file. -
I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy. -
Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?
Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.