linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.59k stars 746 forks source link

Creating a submenu in a menu category like audio video #12253

Open Schmaehgrunza opened 5 months ago

Schmaehgrunza commented 5 months ago

Distribution

21.3

Package version

6.2.2

Graphics hardware in use

NVIDIA Corporation GP107 [GeForce GTX 1050 Ti]

Frequency

Always

Bug description

created a submenu in menu Audio Video (Multimedia) with menu editor. Menu editor shows it is there, but menu doesnt display it. menueditor testsubmenu menu

applications.menu file

<?xml version="1.0" ?>
<!DOCTYPE Menu
  PUBLIC '-//freedesktop//DTD Menu 1.0//EN'
  'http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd'>
<Menu>
    <Name>Applications</Name>
    <Directory>cinnamon-menu-applications.directory</Directory>
    <!-- Read standard .directory and .desktop file locations -->
    <DefaultAppDirs/>
    <DefaultDirectoryDirs/>
    <!-- Read in overrides and child menus from applications-merged/ -->
    <DefaultMergeDirs/>
    <!-- Accessories submenu -->
    <Menu>
        <Name>Accessories</Name>
        <Directory>cinnamon-utility.directory</Directory>
        <Include>
            <And>
                <Category>Utility</Category>
                <!-- Accessibility spec must have either the Utility or Settings
         category, and we display an accessibility submenu already for
         the ones that do not have Settings, so don't display accessibility
         applications here -->
                <Not>
                    <Category>Accessibility</Category>
                </Not>
                <Not>
                    <Category>System</Category>
                </Not>
            </And>
        </Include>
    </Menu>
    <!-- End Accessories -->
    <!-- Accessibility submenu -->
    <Menu>
        <Name>Universal Access</Name>
        <Directory>cinnamon-utility-accessibility.directory</Directory>
        <Include>
            <And>
                <Category>Accessibility</Category>
                <Not>
                    <Category>Settings</Category>
                </Not>
            </And>
        </Include>
    </Menu>
    <!-- End Accessibility -->
    <!-- Development Tools -->
    <Menu>
        <Name>Development</Name>
        <Directory>cinnamon-development.directory</Directory>
        <Include>
            <And>
                <Category>Development</Category>
            </And>
            <Filename>emacs.desktop</Filename>
        </Include>
    </Menu>
    <!-- End Development Tools -->
    <!-- Education -->
    <Menu>
        <Name>Education</Name>
        <Directory>cinnamon-education.directory</Directory>
        <Include>
            <And>
                <Category>Education</Category>
            </And>
        </Include>
    </Menu>
    <!-- End Education -->
    <!-- Games -->
    <Menu>
        <Name>Games</Name>
        <Directory>cinnamon-game.directory</Directory>
        <Include>
            <And>
                <Category>Game</Category>
            </And>
        </Include>
    </Menu>
    <!-- End Games -->
    <!-- Graphics -->
    <Menu>
        <Name>Graphics</Name>
        <Directory>cinnamon-graphics.directory</Directory>
        <Include>
            <And>
                <Category>Graphics</Category>
            </And>
        </Include>
    </Menu>
    <!-- End Graphics -->
    <!-- Internet -->
    <Menu>
        <Name>Internet</Name>
        <Directory>cinnamon-network.directory</Directory>
        <Include>
            <And>
                <Category>Network</Category>
            </And>
        </Include>
    </Menu>
    <!-- End Internet -->
    <!-- Multimedia -->
    <Menu>
        <Name>Multimedia</Name>
        <Directory>cinnamon-audio-video.directory</Directory>
        <Include>
            <And>
                <Category>AudioVideo</Category>
            </And>
        </Include>
        <DefaultLayout inline="false"/>
        <Menu>
            <Name>alacarte-made-1b89f972-300f-11ef-94e8-31f654d4ccb9</Name>
            <Directory>alacarte-made-1b89f972-300f-11ef-94e8-31f654d4ccb9.directory</Directory>
            <Include>
                <Filename>hypnotix.desktop</Filename>
            </Include>
            <AppDir>/home/lithium/.local/share/applications</AppDir>
            <Include>
                <Filename>War Thunder-2f997c38-3011-11ef-94e8-31f654d4ccb9.desktop</Filename>
            </Include>
        </Menu>
        <Layout>
            <Merge type="menus"/>
            <Filename>io.github.celluloid_player.Celluloid.desktop</Filename>
            <Filename>fr.handbrake.ghb.desktop:flatpak</Filename>
            <Filename>hypnotix.desktop</Filename>
            <Filename>rhythmbox.desktop</Filename>
            <Filename>vlc.desktop</Filename>
            <Merge type="files"/>
        </Layout>
    </Menu>
    <!-- End Multimedia -->
    <!-- Office -->
    <Menu>
        <Name>Office</Name>
        <Directory>cinnamon-office.directory</Directory>
        <Include>
            <And>
                <Category>Office</Category>
            </And>
        </Include>
    </Menu>
    <!-- End Office -->
    <!-- System Tools-->
    <Menu>
        <Name>System</Name>
        <Directory>cinnamon-system-tools.directory</Directory>
    </Menu>
    <!-- End System Tools -->
    <!-- Other -->
    <Menu>
        <Name>Other</Name>
        <Directory>cinnamon-other.directory</Directory>
        <OnlyUnallocated/>
        <Include>
            <And>
                <Not>
                    <Category>Core</Category>
                </Not>
                <Not>
                    <Category>Settings</Category>
                </Not>
                <Not>
                    <Category>Screensaver</Category>
                </Not>
            </And>
        </Include>
    </Menu>
    <!-- End Other -->
    <!-- Wine -->
    <Menu>
        <Name>wine-wine</Name>
        <Directory>wine-wine.directory</Directory>
        <Include>
            <And>
                <Category>Wine</Category>
            </And>
        </Include>
    </Menu>
    <!-- End Wine -->
    <Menu>
        <Name>Preferences</Name>
        <Directory>cinnamon-settings.directory</Directory>
        <Include>
            <And>
                <Category>Settings</Category>
                <Not>
                    <Category>System</Category>
                </Not>
            </And>
        </Include>
    </Menu>
    <!-- System Settings -->
    <Menu>
        <Name>Administration</Name>
        <Directory>cinnamon-settings-system.directory</Directory>
        <Include>
            <And>
                <Category>Settings</Category>
                <Category>System</Category>
            </And>
        </Include>
        <Include>
            <And>
                <Category>System</Category>
                <Not>
                    <Category>Settings</Category>
                </Not>
            </And>
        </Include>
    </Menu>
    <!-- End System Settings -->
    <DefaultLayout inline="false"/>
    <Menu>
        <Name>alacarte-made-9ac2d370-3010-11ef-94e8-31f654d4ccb9</Name>
        <Directory>alacarte-made-9ac2d370-3010-11ef-94e8-31f654d4ccb9.directory</Directory>
        <Include>
            <Filename>Hypnotix-a888b04c-3010-11ef-94e8-31f654d4ccb9.desktop</Filename>
        </Include>
        <AppDir>/home/lithium/.local/share/applications</AppDir>
    </Menu>
    <Layout>
        <Merge type="menus"/>
        <Menuname>webapps-webapps</Menuname>
        <Menuname>Accessories</Menuname>
        <Menuname>Education</Menuname>
        <Menuname>Games</Menuname>
        <Menuname>Graphics</Menuname>
        <Menuname>Internet</Menuname>
        <Menuname>Office</Menuname>
        <Menuname>Other</Menuname>
        <Menuname>Development</Menuname>
        <Menuname>Multimedia</Menuname>
        <Menuname>System</Menuname>
        <Menuname>Universal Access</Menuname>
        <Menuname>wine-wine</Menuname>
        <Menuname>Preferences</Menuname>
        <Menuname>Administration</Menuname>
        <Merge type="files"/>
    </Layout>
</Menu>
<!-- End Applications -->

Is there a documentation for this menu file. i want to write an editor, which works?

Steps to reproduce

create a submenu in a menucategory

Expected behavior

submenu shows up in Multimedia

Additional information

No response

fredcw commented 5 months ago

Cinnamon's cmenu (https://github.com/linuxmint/cinnamon-menus) implements the desktop menu specification (https://freedesktop.org/wiki/Specifications/menu-spec/) and reads the .menu and .desktop files and provides the data to the menu applets. It's the menu applets that combine the submenus into one top level menu category. All cinnamon's menu applets do the same (Cinnamenu@json, CinnVIIStarkMenu@NikoKrause). For a menu applet to show the subcategories, you'd have to think about how that would be implemented in terms of the applet's GUI.