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

DesktopConfiguration shared: keep windows in-situ #697

Merged
merged 1 commit into from Sep 19, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions fvwm/add_window.c
Expand Up @@ -2131,6 +2131,7 @@ FvwmWindow *AddWindow(
const exec_context_t *exc2;
exec_context_changes_t ecc;
struct monitor *mon;
extern Bool Restarting;

/****** init window structure ******/
setup_window_structure(&tmp, w, ReuseWin);
Expand Down
3 changes: 3 additions & 0 deletions fvwm/placement.c
Expand Up @@ -328,6 +328,7 @@ adjust_for_shared_placement(FvwmWindow *fw, const exec_context_t *exc)
struct monitor *m;
char *cmd;
window_style style;
extern Bool Restarting;

if (!is_tracking_shared)
return;
Expand Down Expand Up @@ -371,6 +372,8 @@ adjust_for_shared_placement(FvwmWindow *fw, const exec_context_t *exc)
free(cmd);
}
done:
if (Restarting)
return;
TAILQ_FOREACH(m, &monitor_q, entry) {
if (m->virtual_scr.CurrentDesk == fw->Desk) {
xasprintf(&cmd, "MoveToScreen %s", m->si->name);
Expand Down
16 changes: 15 additions & 1 deletion fvwm/virtual.c
Expand Up @@ -73,7 +73,8 @@
#define CMD_MOVE_SCREEN_DESK(m, d) \
do { \
char *cmd; \
xasprintf(&cmd, "All (!Screen %s, Desk %d, !CirculateHit) " \
xasprintf(&cmd, \
"All (!Screen %s, Desk %d, CurrentPage, !CirculateHit) "\
"MoveToPage %s $[w.pagex] $[w.pagey]", \
(m)->si->name, (d), (m)->si->name); \
execute_function_override_window( \
Expand Down Expand Up @@ -2249,11 +2250,24 @@ void CMD_DesktopConfiguration(F_CMD_ARGS)
{
FvwmWindow *t;
struct monitor *m = monitor_get_current();
extern Bool Restarting;

if (action == NULL) {
fvwm_debug(__func__, "action is required");
return;
}
if ((Restarting && !Scr.flags.are_windows_captured) &&
strcasecmp(action, "shared") == 0) {
fvwm_debug(__func__, "Restarting and in shared mode...");
if (!is_tracking_shared) {
fvwm_debug(__func__, "Restarting and setting "
"is_tracking_shared to true...");
is_tracking_shared = true;
monitor_mode = MONITOR_TRACKING_G;
}
fvwm_debug(__func__, "All done.");
goto update;
}

if (strcasecmp(action, "global") == 0) {
struct monitor *m_loop;
Expand Down
1 change: 0 additions & 1 deletion libs/FScreen.h
Expand Up @@ -47,7 +47,6 @@ enum monitor_tracking
{
MONITOR_TRACKING_G = 1,
MONITOR_TRACKING_M,
MONITOR_TRACKING_S,
};

extern enum monitor_tracking monitor_mode;
Expand Down