Skip to content

cinnamon-desktop-editor: Fix panel launcher edits hanging the dialog and not refreshing the panel#13896

Open
rubinlinux wants to merge 2 commits into
linuxmint:masterfrom
rubinlinux:fix-panel-launcher-edit
Open

cinnamon-desktop-editor: Fix panel launcher edits hanging the dialog and not refreshing the panel#13896
rubinlinux wants to merge 2 commits into
linuxmint:masterfrom
rubinlinux:fix-panel-launcher-edit

Conversation

@rubinlinux

Copy link
Copy Markdown

Fixes #13895

Two small fixes to the panel launcher edit flow:

  • panel_launcher_cb assumed launchers.index() returns -1 when the entry is missing (see the if i >= 0: right after it), but it raises ValueError. The unhandled exception meant Gtk.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 updateSetting dbus 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.

… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editing a panel launcher hangs on OK; orphan cinnamon-custom-launcher-N.desktop files accumulate

1 participant