lxqt / lxqt-panel

The LXQt desktop panel
https://lxqt-project.org
GNU Lesser General Public License v2.1
180 stars 135 forks source link

Fancy Menu: misbehavior if an favorite app is disinstalled. #2028

Open stefonarch opened 7 months ago

stefonarch commented 7 months ago

Removing an application which was previously added to the favorites menu triggers 2 errors:

screen_area_mar_20:11:06_

Expected Behavior

An error should be displayed if launched

Current Behavior

It gets removed if panel is restarted.

See above

Steps to Reproduce (for bugs)
  1. Add an application to favorites
  2. Disinstall it
  3. Click the item, right click the item in the menu/favorites
System Information
stefonarch commented 7 months ago

Didn't test immediately panel restart. So it's not a big thing.

tsujan commented 7 months ago

We have telepathy: today I was going to test exactly the same thing.

Why did you close it? If an app is removed, it's logical to expect that its corresponding item under Favorites should be removed the next time Fancy Menu is shown.

stefonarch commented 7 months ago

I stumpled by chance open that, in my debian testing VM I had 2 pcmanfm, the gtk one and ours, so I removed it and saw it.

tsujan commented 7 months ago

That doesn't rule out telepathy ;)

gfgit commented 7 months ago

We could detect .desktop file being deleted with a dir watcher. And also use XdgDesktopFile::tryExec() for some rare case where executable is removed but desktop file is kept and remove items returning false (might have some side effects if keeping desktop file was intended behavior). Is there some hook like xdg updating mime cache which will inform desktop files changed?

Also please tag me in things related to FancyMenu because I really like following it's baby steps. Sometimes I miss these discussions.

stefonarch commented 7 months ago

Also please tag me in things related to FancyMenu because I really like following it's baby steps. Sometimes I miss these discussions.

You can "watch" lxqt-panel and other repos of interest, to miss nothing.

tsujan commented 7 months ago

We could detect .desktop file being deleted with a dir watcher.

I haven't looked into it yet, but I don't think watching desktop entries is the solution, because they can be in ~/.local/share/applications and persist after uninstalling apps.

tsujan commented 7 months ago

Perhaps the most resource-friendly approach is tell the user about the absence of their executables (e.g., by showing a message when he tries to activate them) and let him to remove them. Just a suggestion....

gfgit commented 7 months ago

You can "watch" lxqt-panel and other repos of interest, to miss nothing.

Thanks did't think of that.

Perhaps the most resource-friendly approach is tell the user about the absence of their executables (e.g., by showing a message when he tries to activate them) and let him to remove them. Just a suggestion....

I like it. Also I don't expect this would happen frequently.