JakeStanger / ironbar

Customisable Wayland gtk bar written in Rust.
https://crates.io/crates/ironbar
MIT License
486 stars 36 forks source link

Tray has weird click behaviour #613

Open ToxicMushroom opened 1 month ago

ToxicMushroom commented 1 month ago

Describe the bug Double clicking on tray icons does not close the tray popup again. Triple clicking does but only if enough time passed. Quadrupple clicking seems to always close it again x), or I'm too slow.

The other modules don't show this behavior and their popups go away on the second click as expected. (e.g. sound, time/calendar, notifications)

To Reproduce Steps to reproduce the behavior:

  1. Have tray module
  2. Have something in the tray
  3. Click fast twice on tray icon
  4. Menu didn't close again

Expected behavior Menu closes on second click.

System information:

Configuration

Config ``` anchor_to_edges = true height = 42 position = "top" icon_theme = "Papirus-Dark" [[start]] type = "workspaces" all_monitors = false on_scroll_up = "swaymsg workspace prev_on_output" on_scroll_down = "swaymsg workspace next_on_output" [[end]] type = "music" player_type = "mpd" music_dir = "/home/merlijn/Music" #[end.truncate] #mode = "end" #max_length = 100 [[end]] type = "music" player_type = "mpd" truncate = "end" [[end]] type = "sys_info" format = [ " {cpu_percent}% | {temp_c:k10temp-Tccd1}°C", " {memory_used} / {memory_total} GB ({memory_percent}%)", "󰋊 {disk_used:/} / {disk_total:/} GB ({disk_percent:/}%)", "󰓢 {net_down:enp5s0} / {net_up:enp5s0} Mbps", ] [end.interval] memory = 30 cpu = 1 temps = 5 disks = 300 networks = 3 [[end]] type = "volume" format = "{icon} {percentage}%" max_volume = 100 [end.icons] volume_high = "󰕾" volume_medium = "󰖀" volume_low = "󰕿" muted = "󰝟" [end.truncate] mode = "end" length = 50 [[end]] type = "clock" [[end]] type = "tray" direction = "left_to_right" [[end]] type = "notifications" show_count = true [end.icons] closed_none = "󰍥" closed_some = "󱥂" closed_dnd = "󱅯" open_none = "󰍡" open_some = "󱥁" open_dnd = "󱅮" ```
Styles ```css @define-color color_bg alpha(#2d2d2d, 0.7); @define-color color_bg_dark alpha(#1c1c1c, 0.7); @define-color color_border alpha(#424242, 0.7); @define-color color_border_active alpha(#6699cc, 0.7); @define-color color_text #ffffff; @define-color color_urgent #8f0a0a; /* -- base styles -- */ * { font-family: CaskaydiaCove Nerd Font, sans-serif; font-size: 16px; text-shadow: none; border: none; border-radius: 0; opacity: 1.0; } .background { background-color: rgba(0, 0, 0, 0); } button, label { box-shadow: none; background: none; background-color: rgba(0, 0, 0, 0); color: @color_text; } button:hover { background-color: @color_bg_dark; } scale trough { min-width: 1px; min-height: 2px; } #bar { border-top: 1px solid @color_border; background-color: @color_bg; background-image: none; box-shadow: none; } .popup { border: 1px solid @color_border; padding: 1em; } /* -- clipboard -- */ .clipboard { margin-left: 5px; font-size: 1.1em; } .popup-clipboard .item { padding-bottom: 0.3em; border-bottom: 1px solid @color_border; } .popup-clipboard { background-color: @color_bg; } /* -- clock -- */ .clock { font-weight: bold; margin-left: 5px; } .popup-clock .calendar-clock { color: @color_text; font-size: 2.5em; padding-bottom: 0.1em; } .popup-clock { background-color: @color_bg; color: @color_text; } .popup-clock .calendar .header { padding-top: 1em; border-top: 1px solid @color_border; font-size: 1.5em; } .popup-clock .calendar:selected { background-color: @color_border_active; } /* notifications */ .notifications .count { font-size: 0.6rem; background-color: @color_text; color: @color_bg; border-radius: 100%; margin-right: 3px; margin-top: 3px; padding-left: 4px; padding-right: 4px; opacity: 0.7; } /* -- script -- */ .script { padding-left: 10px; } /* -- sys_info -- */ .sysinfo { margin-left: 10px; } .sysinfo .item { margin-left: 5px; } /* -- tray -- */ .tray { background-color: rgba(0,0,0,0); margin-left: 10px; } .tray menu { background-color: rgba(0,0,0, 0.7); padding: 8px 0; } /* Overrides the label text just for the tray */ .tray label { /* color: black; */ } /* -- volume -- */ .popup-volume .device-box { border-right: 1px solid @color_border; } .popup-volume { background-color: @color_bg; } /* -- power -- */ .popup-upower { background-color: @color_bg; } /* -- workspaces -- */ .workspaces .item.focused { box-shadow: inset 0 -3px; background-color: @color_bg_dark; } .workspaces .item:hover { box-shadow: inset 0 -3px; } ```
JakeStanger commented 1 month ago

This behaviour should be down to GTK, as the tray uses actual menu widgets instead of a separate window like the other popups. I'll see if I can work around the strange behaviour though

JakeStanger commented 1 week ago

Finally getting round to clearing through the backlog. I'm not actually able to replicate this one, although I'm also not sure I can do anything about it from googling (I give GTK a sub-menu for the menu widget, it does the rest).

Are you able to demo the issue at all?