Hyprland clients are now fetched from a binding instead of get_clients(). (#642)
* Get clients from bindings. * Active workspaces now show properly on all workspace configurations. * Filter clients by current workspace.
This commit is contained in:
@@ -55,8 +55,9 @@ export const WorkspaceModule = ({ monitor }: WorkspaceModuleProps): JSX.Element
|
||||
bind(applicationIconFallback),
|
||||
bind(matugen),
|
||||
bind(smartHighlight),
|
||||
|
||||
bind(hyprlandService, 'clients'),
|
||||
bind(hyprlandService, 'monitors'),
|
||||
|
||||
bind(ignored),
|
||||
bind(showAllActive),
|
||||
bind(hyprlandService, 'focusedWorkspace'),
|
||||
@@ -84,10 +85,9 @@ export const WorkspaceModule = ({ monitor }: WorkspaceModuleProps): JSX.Element
|
||||
applicationIconFallback: string,
|
||||
matugenEnabled: boolean,
|
||||
smartHighlightEnabled: boolean,
|
||||
clients: AstalHyprland.Client[],
|
||||
monitorList: AstalHyprland.Monitor[],
|
||||
) => {
|
||||
const activeWorkspace = hyprlandService.focusedWorkspace?.id || -99999;
|
||||
|
||||
const workspacesToRender = getWorkspacesToRender(
|
||||
totalWorkspaces,
|
||||
workspaceList,
|
||||
@@ -149,11 +149,8 @@ export const WorkspaceModule = ({ monitor }: WorkspaceModuleProps): JSX.Element
|
||||
monitor,
|
||||
)}
|
||||
setup={(self) => {
|
||||
self.toggleClassName('active', activeWorkspace === wsId);
|
||||
self.toggleClassName(
|
||||
'occupied',
|
||||
(hyprlandService.get_workspace(wsId)?.get_clients()?.length || 0) > 0,
|
||||
);
|
||||
const currentWsClients = clients.filter((client) => client.workspace.id === wsId);
|
||||
self.toggleClassName('occupied', currentWsClients.length > 0);
|
||||
}}
|
||||
/>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user