Aylur / ags

A customizable and extensible shell
GNU General Public License v3.0
1.74k stars 95 forks source link

Hyprland workspaces's `lastwindow` field does not update properly #418

Open augustbbl opened 1 month ago

augustbbl commented 1 month ago

Hello! I use ags to dynamically display icons for the last window used in each workspace: image

For the active workspace, I bind to the active property (which works great), and for inactive workspaces I fall back to the lastwindow field from each element of the workspaces property (as seen via hyprctl workspaces).

However, it seems that workspace information is not updated when the workspace ipc event happens. As a result, when i switch workspaces, the previously active workspace often displays the wrong information. It would be nice if workspace information could also be updated whenever the active workspace changes.

Example:

  1. In workspace 1, I open Firefox, then open Kitty.
  2. I switch to workspace 2. The icon for workspace 1 reflects Kitty, because it was focused when a window was last opened.
  3. I switch back to workspace 1, focus Firefox.
  4. I switch to workspace 2. The icon for workspace 1 should reflect Firefox, because it was last focused, but instead still reflects Kitty, because the workspace information for lastwindow was never updated.