Skip to content

Fix grid layout workspace ID mismatch with split-monitor-workspaces#90

Open
stsolovey wants to merge 1 commit into
raybbian:mainfrom
stsolovey:fix/query-based-grid
Open

Fix grid layout workspace ID mismatch with split-monitor-workspaces#90
stsolovey wants to merge 1 commit into
raybbian:mainfrom
stsolovey:fix/query-based-grid

Conversation

@stsolovey

Copy link
Copy Markdown

Fixes #86

The grid layout uses formula-based workspace ID calculation which doesn't work correctly with split-monitor-workspaces or hyprsplit plugins.

This PR rewrites build_overview_layout() to query actual workspaces from the monitor via getWorkspacesCopy() instead of calculating IDs.

Changes:

  • Query workspaces filtered by current monitor
  • Add virtual workspace IDs for empty grid cells
  • Remove side effects (rawMonitorFocus, moveWorkspaceToMonitor)
  • Add .count() guards for safe map access

Also includes Hyprland 0.53 compatibility from #89.

…compatibility

Rewrites build_overview_layout() to query actual workspaces from monitor
instead of calculating IDs with formula. This fixes workspace ID mismatch
when using split-monitor-workspaces or hyprsplit plugins.

Changes:
- Query workspaces via getWorkspacesCopy() instead of formula calculation
- Add virtual workspace IDs for empty grid cells
- Remove side effects (rawMonitorFocus, moveWorkspaceToMonitor)
- Add .count() guards to init_position(), on_hide(), close_open_lerp(), on_move()

Fixes: raybbian#86
Related: raybbian#87
@stsolovey stsolovey changed the title https://github.com/raybbian/hyprtasking/compare/main...stsolovey:hyprtasking:fix/query-based-grid?expand=1 Fix grid layout workspace ID mismatch with split-monitor-workspaces Jan 1, 2026
@Schlafhase

Schlafhase commented Jan 1, 2026

Copy link
Copy Markdown

This looks promising! Could you explain how exactly the build_overview_layout function works now? Also I think this repo might be abandoned considering that the last commit was 1 month ago and it didn't update to 0.53. Do you want to help me maintain my fork?

@raybbian

raybbian commented Jan 4, 2026

Copy link
Copy Markdown
Owner

Thank you for the PR! Unfortunately, this doesn't allow you to place windows on arbitrary workspaces - you can't place a window on the center workspace for example (that workspace then becomes the first workspace for the monitor).

Ultimately I'd like a way for workspaces to remember which location they were on (This would enable a new layout)

@stsolovey

Copy link
Copy Markdown
Author

@raybbian Makes sense. Thanks for the feedback. I've switched to GNOME for now and can't actively test on Hyprland. Feel free to merge or close as you see fit.

@stsolovey

Copy link
Copy Markdown
Author

@Schlafhase The new approach queries actual workspaces via getWorkspacesCopy() instead of calculating IDs by formula. This makes it compatible with split-monitor-workspaces.

Re: fork collaboration — I've switched to GNOME for now, so can't commit to active maintenance. But thanks for the offer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indices starting at 0 (10) when using multiple monitors and hyprsplit

3 participants