( monitor: string, pointerX: number, pointerY: number, stripPx: number, )
| 160 | } |
| 161 | lastWorkspacesJson = json; |
| 162 | WORKSPACE_IPC.broadcast("workspaces.changed", view); |
| 163 | } |
| 164 | |
| 165 | function reconfigureProtocolWorkspaces() { |
| 166 | COMPOSITOR.workspace.reconfigure(); |
| 167 | } |
| 168 | |
| 169 | // Coalesce many state mutations within one tick into a single diffed broadcast. |
| 170 | function scheduleWorkspaceBroadcast() { |
| 171 | // Protocol state must be staged before the current runtime response is |
| 172 | // written; otherwise key bindings/Waybar activations only reach external |
| 173 | // bars on a later, unrelated runtime request. |
| 174 | reconfigureProtocolWorkspaces(); |
| 175 | if (workspaceBroadcastQueued) { |
| 176 | return; |
| 177 | } |
| 178 | workspaceBroadcastQueued = true; |
| 179 | void Promise.resolve().then(() => { |
| 180 | workspaceBroadcastQueued = false; |
| 181 | broadcastWorkspaces(); |
| 182 | }); |
| 183 | } |
| 184 | |
| 185 | // Workspaces a bar asked to create (by number). The view lists only |
| 186 | // workspaces with windows plus the active one, so these are listed as well |
| 187 | // until they show up there on their own. |
no test coverage detected