Fix circular dependency of applications.menu in KService and plasma-workspace
Open, Needs TriagePublic

Description

For "start menu" is defined by lots of .directory files in plasma-workspace
The file to say which desktop files go in which directory is in kservice

It doesn't seem right.

Things happen to work, until you make a change then we get a situation.

For more details see D24423 where someone is making a change and hitting a problem

IMHO kbuildsycoca should find applications.menu dynamically at runtime from the system it seems it would be more cross desktop?

guoyunhe added a subscriber: guoyunhe.EditedJan 15 2020, 11:03 AM

applications.menu is installed at /etc/xdg/menu/kf5-applications.menu. The folder contains multiple *.menu files. The freedesktop.org spec is here https://freedesktop.org/wiki/Specifications/menu-spec/

Plasma is able to read:

  • applications.menu
  • kf5-applications.menu
  • applications-merged/*.menu

If I install the new file as kf5-applications-new.menu or kf6-applications.menu, it gets ignored.

@guoyunhe can you propose a solution for KF6 that would make sure we don't have future conflicts

Move applications.menu from kservice repository to plasma-workspace repository.

dfaure added a subscriber: dfaure.Jan 15 2020, 3:01 PM

Makes sense I guess. The code to parse the menu files is still in kservice/src/sycoca/vfolder_menu.cpp but kservice's job is just to read whatever is there, it doesn't need to provide it by itself. We'll just keep an uninstalled copy for the autotest ;)

Just to flesh that out more. KF5 will be presumably be co-installable with KF6 and Plasma 6 so we can't just move the file.

We would need to:

  • move to p-w under a different name
  • update the default APPLICATIONS_MENU_NAME in kservice

Given we have to handle a rename anyway, it's presumably doable within the KF5 lifetime?

If we want to ship applications.menu with Plasma 5.18.0 that needs to happen effectively today.

guoyunhe added a comment.EditedJan 17 2020, 3:30 PM

Look like we didn't catch the opportunity of Plasma 5.18.0. But I have some idea on the naming.

*.directory files are located in plasma-workspace/menu/desktop/*.directory. So I guess the applications.menu file should be moved to plasma-workspace/menu/desktop/applications.menu. Maybe in future, there will also be different category trees for Plasma Mobile or Plasma Tablet.

Then the *.menu file can be installed with name like plasma5-applications.menu. And future KDE6 can have plasma6-applications.menu. Because these files will come from Plasma packages, instead of KF5 packages.

The work plan is:

  1. Copy applications.menu to plasma-workspace and install it at /etc/xdg/menus/plasma5-applications.menu.
  2. Let kbuildsycoca detect existence of both plasma5-applications.menu and kf5-applications.menu. Prefer the new one if both exists.
  3. Add deprecation comments in the applications.menu file in kservice repository. It will stay here in until the end of KF5 for compatibility with old plasma workspace.