SUMMARY Demonstrative video: https://www.youtube.com/watch?v=GXoRi0bhBoM I am trying to edit the display name of an application through the GUI. After pressing OK, Plasma freezes almost completely and gets stuck in the "File already exist" dialogue. The only solution is to restart. STEPS TO REPRODUCE 1. Open Application Launcher 2. Select an entry to edit. In my example I used Steam run in wine, so the .desktop file is in the home directory 3. Edit the "Name:" atrribute in the Application tab OBSERVED RESULT The whole Plasma desktop freezes when the "File already exist" dialogue appears EXPECTED RESULT The desktop should not freeze SOFTWARE/OS VERSIONS Linux/KDE Plasma: Arch Linux KDE Plasma Version: 5.20.5 KDE Frameworks Version: 5.78.0 Qt Version: 5.15.2 ADDITIONAL INFORMATION
From the video we're not frozen, but stuck in a nested event loop. It is presumably this line here frameworks/kio kpropertiesdialog.cpp:1543 KIO::copyJob... .... QEventLoop eventLoop; eventLoop.exec(QEventLoop::ExcludeUserInputEvents); Event loops from plasma are bad anyway, but with this one if the copy job prompts, it won't handle the user event. We're best trying to port away from the event loop if that's possible within the API
I just came to the conclusion as David. Commenting out the line makes the dialog responsive again, although the rest of Plasma is still blocked, but that is probably expected since Dolphin behaves the same
Created attachment 135046 [details] These are the only affected files. So it seems that only .desktop files inside another folder inside ~/.local/share/applications are affected. None of the files in the root folder cause the loop.
I can make Dolphin freeze the same way by just creating a file called "a" and one named "aa" and then trying to rename it to "a"
Even bin/kpropertiesdialogtest locks up itself
Bisected to 4c12899369f43009269d0fdb80964483365bb922
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/324
Git commit 0300441bb80c3d75a305bc7b1f4a7e1c36f28845 by David Redondo. Committed on 25/01/2021 at 11:26. Pushed by dfaure into branch 'master'. Fix lockup when renaming a file from properties dialog 4c12899369f43009269d0fdb80964483365bb922 changed how we show the rename dialog. Before we would exec() it and now we call show(). This causes a lockup when renaming a file from the properties dialog to a filename that already exsist. Optimally we would change KPropertiesDialog to make it async and not use nested event loops but this fixes the lockup for now. M +2 -2 src/widgets/kpropertiesdialog.cpp https://invent.kde.org/frameworks/kio/commit/0300441bb80c3d75a305bc7b1f4a7e1c36f28845