Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

wlr/taskbar on multi-monitor: icons not displayed for apps launched before waybar

Open abc-nix opened this issue 1 month ago • 2 comments

Wayland compositor: sway (v 1.9) or Hyprland (0.41.1) [error happens with both]

Waybar version: 0.10.3

I have 2 monitors (output LVDS-1 and HDMI-A-1), and the exact same waybar configuration is applied to both. Specifically for wlr/taskbar:

wlr/taskbar config
    "wlr/taskbar": {
      "format": "{icon}",
      "icon-size": 24,
      "on-click": "activate",
      "on-click-middle": "close",
    },

Observations:

  1. If waybar has already started, all new apps that I open will display the correct icon on any of the waybar taskbars on both monitors.
  2. If waybar starts later, with an app already open, the icon is only displayed correctly in one of the taskbars (the one in HDMI-A-1), and not on the other (there is an empty space with no icon, though it works when clicked and tooltips are displayed).

Logs:

By using log-level trace, I see that icons are found and "Loaded" for all open applications, but only are "now visible" on the HDMI-A-1 output. When the icon is "loaded" for the application on LVDS-1, it isn't "now visible". See examples below:

Example on HDMI-A-1:

Task (4) overwriting app_id 'unknown' with 'firefox-esr'
Task (4) Mozilla Firefox Private Browsing [firefox-esr] <amif> Loaded icon 'firefox-esr'
Task (4) Mozilla Firefox Private Browsing [firefox-esr] <amif> entered output 0x5d274d223ef0
Task (4) Mozilla Firefox Private Browsing [firefox-esr] <amif> now visible on HDMI-A-1
Task (4) Mozilla Firefox Private Browsing [firefox-esr] <amif> changed

Example on LVDS-1:

Task (7) overwriting app_id 'unknown' with 'thunar'
Task (7) waybar - Thunar [thunar] <amif> Loaded icon 'org.xfce.thunar'
Task (7) waybar - Thunar [thunar] <amif> entered output 0x5d274d2bc930
Task (7) waybar - Thunar [thunar] <amif> changed

As you can see, on LVDS-1, the line "now visible on LVDS-1" is missing. I think this could help find the issue.

I have attached the trace logs in case it is helpful.

Operations performed:

  1. Run sway with 2 apps open on each monitor (4 apps in total, foot and thunar on LVDS-1, firefox and geany on HDMI-A-1).
  2. Start waybar.
  3. Move the cursor to the LVDS-1 monitor (on thunar).
  4. Open a new foot terminal (icon is correctly rendered for this app on LVDS-1).
  5. Kill waybar.

I will provide any information required to help understand and fix this bug.

waybar.log

abc-nix avatar Jun 17 '24 04:06 abc-nix