Astal icon indicating copy to clipboard operation
Astal copied to clipboard

error when handling workspaces with astal-hyprland

Open nakoo opened this issue 8 months ago • 0 comments

Describe the bug

~ % astal-hyprland 
{ event: "createworkspace", payload: "2" }
{ event: "activewindow", payload: "," }
{ event: "activewindowv2", payload: "" }
{ event: "workspace", payload: "2" }
{ event: "createworkspacev2", payload: "-1337,2" }
{ event: "workspacev2", payload: "-1337,2" }
{ event: "activewindow", payload: "foot,foot" }
{ event: "activewindowv2", payload: "18c24a10" }
{ event: "workspace", payload: "1" }
{ event: "workspacev2", payload: "1,1" }
{ event: "destroyworkspace", payload: "2" }
{ event: "destroyworkspacev2", payload: "-1337,2" }

When using astal-hyprland, the output for workspace events is incorrect when switching to workspace 2 (or higher). For example, when workspace 1 is active, it returns the correct value, but when switching to workspace 2 (or higher), the workspacev2 event returns incorrect value such as "-1337,2".

To Reproduce

  1. Run astal-hyprland,
  2. Move among the workspaces.
  3. Check when switching to workspace 2 (or higher), the workspacev2 event output is incorrect.

Expected behavior Should return the correct workspace value so that the user can interact with them properly.

Additional context I also tested with the gtk3 simple-bar example, but it shows incorrect workspace numbers. When I clicked on either -1339 or -1338, ags returned the following error:

** (gjs:133989): CRITICAL **: 00:19:04.459: hyprland.vala:207: dispatch error: Previous workspace doesn't exist

Image

~ % Hyprland --version
Hyprland 0.48.0 built from branch  at commit f7ba86d1f335112ae0d13548947ddbd76b1477b6  ().
Date: 2025-03-24
Tag: v0.48.0, commits: 
built against:
 aquamarine 0.8.0
 hyprlang 0.6.0
 hyprutils 0.5.2
 hyprcursor 0.1.12
 hyprgraphics 0.1.2


no flags were set

nakoo avatar Mar 26 '25 00:03 nakoo