cinnamon-desktop-editor: Fix panel launcher edits hanging the dialog and not refreshing the panel#13896
Open
rubinlinux wants to merge 2 commits into
Open
cinnamon-desktop-editor: Fix panel launcher edits hanging the dialog and not refreshing the panel#13896rubinlinux wants to merge 2 commits into
rubinlinux wants to merge 2 commits into
Conversation
… when the edited entry is missing from launcherList. list.index() raises ValueError rather than returning -1 (the dead 'if i >= 0:' check suggests indexOf-style semantics were assumed). The unhandled exception in the dialog callback meant Gtk.main_quit() was never reached, leaving the dialog open forever and an orphaned cinnamon-custom-launcher-N.desktop file behind on every attempt. Ref: linuxmint#13895
…st so the panel updates without a restart. Cinnamon does not monitor xlet settings files - external changes only reach a running xlet via the org.Cinnamon updateSetting dbus method, which xlet-settings.py already uses after saving. Without this, an edited or added panel launcher didn't appear until Cinnamon was restarted, which also baited users into re-editing and hitting the stale-entry case. Ref: linuxmint#13895
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13895
Two small fixes to the panel launcher edit flow:
panel_launcher_cbassumedlaunchers.index()returns -1 when the entry is missing (see theif i >= 0:right after it), but it raises ValueError. The unhandled exception meantGtk.main_quit()was never reached, so the dialog hung on OK and an orphaned cinnamon-custom-launcher-N.desktop was left behind on every attempt. The callback now handles the missing entry (the edited launcher gets appended instead of dropped) and always closes the dialog.After saving, the editor now tells Cinnamon to reload the applet settings via the org.Cinnamon
updateSettingdbus call, the same way xlet-settings.py does after it saves. Without this the panel didn't reflect an add/edit until Cinnamon was restarted - which is also what baited users into editing a second time and hitting the hang above.Tested on Mint 22.3 / Cinnamon 6.6.9: editing a launcher now updates the panel within a second or two, repeated edits don't hang, and no orphan files pile up.
One pre-existing wart deliberately left alone to keep this small: editing an already-custom launcher overwrites its .desktop file in place, so launcherList doesn't change and the panel won't show the new name/icon until a restart. Fixing that would need the applet to reload launchers whose files changed on disk, which seemed out of scope here.