Skip to content

BUG: When using custom menus in config.jsonc the element stays in the "hovered" state on the bar permanently #4638

@MeshVoid

Description

@MeshVoid

OS: Arch Linux x86_64
Hyprland
Kernel: Linux 6.17.7-arch1-1
waybar 0.14.0-4

I've started using custom menu popups on my waybar and I noticed that they work a bit glitchy. When you click on an element that has "menu": "on-click", "menu-file": "custom-menu.xml" in it that icon/element stays in a hovered state forever until you move your mouse cursor again on that element so that it would trigger the "hovered" state again.

Use a standard example from wiki to replicate:

config.jsonc:

"custom/power": {
    "format" : "⏻ ",
        "tooltip": false,
        "menu": "on-click",
        "menu-file": "~/.config/waybar/power_menu.xml",
        "menu-actions": {
            "shutdown": "shutdown",
            "reboot": "reboot",
            "suspend": "systemctl suspend",
            "hibernate": "systemctl hibernate",
        },
},

~/.config/waybar/power_menu.xml:

<?xml version="1.0" encoding="UTF-8"?>
<interface>
    <object class="GtkMenu" id="menu">
        <child>
            <object class="GtkMenuItem" id="suspend">
                <property name="label">Suspend</property>
            </object>
        </child>
        <child>
            <object class="GtkMenuItem" id="hibernat">
                <property name="label">Hibernate</property>
            </object>
        </child>
        <child>
            <object class="GtkMenuItem" id="shutdown">
                <property name="label">Shutdown</property>
            </object>
        </child>
        <child>
            <object class="GtkSeparatorMenuItem" id="delimiter1" />
        </child>
        <child>
            <object class="GtkMenuItem" id="reboot">
                <property name="label">Reboot</property>
            </object>
        </child>
    </object>
</interface>

Observe how the element stays in the "hovered" state after you use it and your mouse cursor is no way near the waybar itself. Make sure you have hovered style distinct in your style.css, naturally. Most likely, hovered state of the element should turned off, as soon as the menu pops up or when that menu is closed or some of the options are chosen, but it doesn't for some reason.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions