Skip to content

Commit

Permalink
Fix bug in moveWindowToWorkspace
Browse files Browse the repository at this point in the history
  • Loading branch information
nir9 committed Oct 3, 2024
1 parent 8feda34 commit c9cf9df
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tiling.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,16 @@ void gotoWorkspace(int number)

void moveWindowToWorkspace(int workspaceNumber)
{
if (numOfCurrentlyManaged == 0) {
if (numOfCurrentlyManaged == 0 || workspaceNumber == currentWorkspace) {
return;
}

ManagedWindow* mw = searchManaged(GetForegroundWindow());
if (mw == NULL) {
ManagedWindow* managedWindow = searchManaged(GetForegroundWindow());
if (managedWindow == NULL) {
return;
}

mw->workspaceNumber = workspaceNumber;
gotoWorkspace(currentWorkspace);
CloseWindow(managedWindow->handle);
managedWindow->workspaceNumber = workspaceNumber;
tileWindows();
}

0 comments on commit c9cf9df

Please sign in to comment.