Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

desk_add: fix window counting #716

Merged
merged 2 commits into from
Oct 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions fvwm/placement.c
Original file line number Diff line number Diff line change
Expand Up @@ -2436,6 +2436,8 @@ Bool setup_window_placement(
__explain_placement(fw, &reason);
}

desk_add_fw(fw);

return (rc == 0) ? False : True;
}

Expand Down
12 changes: 11 additions & 1 deletion fvwm/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "eventmask.h"
#include "misc.h"
#include "screen.h"
#include "update.h"
#include "virtual.h"
#include "module_interface.h"
#include "module_list.h"
Expand All @@ -48,6 +49,7 @@
#include "icons.h"
#include "stack.h"
#include "functions.h"
#include "builtins.h"

/* ---------------------------- local definitions -------------------------- */

Expand Down Expand Up @@ -1825,6 +1827,8 @@ void do_move_window_to_desk(FvwmWindow *fw, int desk)
focus_grab_buttons_on_layer(fw->layer);
EWMH_SetWMDesktop(fw);

desk_add_fw(fw);

return;
}

Expand Down Expand Up @@ -2964,7 +2968,7 @@ desk_add_fw(FvwmWindow *fw)
if (fw == NULL)
return;

desk = fw->m->virtual_scr.CurrentDesk;
desk = fw->Desk;

if (TAILQ_EMPTY(&desktop_fvwm_q))
TAILQ_INIT(&desktop_fvwm_q);
Expand All @@ -2982,6 +2986,9 @@ desk_add_fw(FvwmWindow *fw)
dfws = fxcalloc(1, sizeof *dfws);
dfws->fw = fw;
TAILQ_INSERT_TAIL(&df_loop->desk_fvwmwin_q, dfws, entry);

status_send();

return;
}
}
Expand All @@ -2994,6 +3001,8 @@ desk_add_fw(FvwmWindow *fw)

TAILQ_INSERT_TAIL(&df->desk_fvwmwin_q, dfws, entry);
TAILQ_INSERT_TAIL(&desktop_fvwm_q, df, entry);

status_send();
}

void
Expand All @@ -3007,6 +3016,7 @@ desk_del_fw(FvwmWindow *fw)
if (dfws->fw == fw) {
TAILQ_REMOVE(&df->desk_fvwmwin_q, dfws, entry);
free(dfws);
status_send();
break;
}
}
Expand Down