mirror of
https://github.com/vale981/bspwm
synced 2025-03-06 02:01:42 -05:00
Consolidate transfer_desktop
This commit is contained in:
parent
f19cf121d7
commit
9cac7cd459
2 changed files with 18 additions and 7 deletions
|
@ -451,16 +451,11 @@ void process_message(char *msg, char *rsp)
|
|||
if (!parse_send_option(opt, &o))
|
||||
return;
|
||||
desktop_t *d = mon->desk;
|
||||
desktop_hide(d);
|
||||
transfer_desktop(mon, m, d);
|
||||
desktop_show(mon->desk);
|
||||
arrange(m, d);
|
||||
if (o == SEND_OPTION_FOLLOW) {
|
||||
if (o == SEND_OPTION_FOLLOW)
|
||||
focus_node(m, d, d->focus);
|
||||
} else if (o == SEND_OPTION_DONT_FOLLOW) {
|
||||
else if (o == SEND_OPTION_DONT_FOLLOW)
|
||||
update_current();
|
||||
put_status();
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
16
types.c
16
types.c
|
@ -93,8 +93,24 @@ void remove_monitor(monitor_t *m)
|
|||
|
||||
void transfer_desktop(monitor_t *ms, monitor_t *md, desktop_t *d)
|
||||
{
|
||||
desktop_t *dd = ms->desk;
|
||||
unlink_desktop(ms, d);
|
||||
insert_desktop(md, d);
|
||||
if (d == dd) {
|
||||
desktop_show(ms->desk);
|
||||
if (md->desk != d)
|
||||
desktop_hide(d);
|
||||
}
|
||||
for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n, d->root))
|
||||
fit_monitor(md, n->client);
|
||||
if (d->focus != NULL && d->focus->client->fullscreen)
|
||||
window_move_resize(d->focus->client->window, md->rectangle.x, md->rectangle.y, md->rectangle.width, md->rectangle.height);
|
||||
arrange(md, d);
|
||||
if (d != dd && md->desk == d) {
|
||||
desktop_show(d);
|
||||
}
|
||||
put_status();
|
||||
ewmh_update_desktop_names();
|
||||
}
|
||||
|
||||
void merge_monitors(monitor_t *ms, monitor_t *md)
|
||||
|
|
Loading…
Add table
Reference in a new issue