Skip to content
Discussion options

You must be logged in to vote

Hi, there is no magic way to compute workspaces for views. Workspaces are arranged in a grid and views can freely move between them, overlapping multiple workspaces, which is why there isn't really a single "workspace" assigned to a view. Most of the time, we use a heuristic. Compute the center point of a view, and divide it by the output resolution. As view geometry is relative to the current workspace, this would give you a rough idea on which workspace the view is, relative to the current one. Small example:

  • 3x3 workspace grid, currently on workspace 1,1 (the center as indexing starts from 0)
  • Output has size 1920x1080
  • A view has its center point at -640, 1090
  • -640/1920 = -0.333, floor…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@guy-black
Comment options

Answer selected by guy-black
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants