mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-12 13:30:01 -05:00
feat: add option exchange_cross_monitor
This commit is contained in:
parent
a45b4cf55e
commit
b97f5928cf
3 changed files with 30 additions and 4 deletions
28
src/mango.c
28
src/mango.c
|
|
@ -4079,7 +4079,12 @@ void setborder_color(Client *c) {
|
|||
}
|
||||
|
||||
void exchange_two_client(Client *c1, Client *c2) {
|
||||
if (c1 == NULL || c2 == NULL || c1->mon != c2->mon) {
|
||||
|
||||
Monitor *tmp_mon;
|
||||
unsigned int tmp_tags;
|
||||
|
||||
if (c1 == NULL || c2 == NULL ||
|
||||
(!exchange_cross_monitor && c1->mon != c2->mon)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -4120,8 +4125,18 @@ void exchange_two_client(Client *c1, Client *c2) {
|
|||
tmp2_next->prev = &c1->link;
|
||||
}
|
||||
|
||||
arrange(c1->mon, false);
|
||||
focusclient(c1, 0);
|
||||
if (exchange_cross_monitor) {
|
||||
tmp_mon = c2->mon;
|
||||
tmp_tags = c2->tags;
|
||||
setmon(c2, c1->mon, c1->tags, false);
|
||||
setmon(c1, tmp_mon, tmp_tags, false);
|
||||
arrange(c1->mon, false);
|
||||
arrange(c2->mon, false);
|
||||
focusclient(c1, 0);
|
||||
} else {
|
||||
arrange(c1->mon, false);
|
||||
focusclient(c1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void // 17
|
||||
|
|
@ -4521,7 +4536,12 @@ void setmon(Client *c, Monitor *m, unsigned int newtags, bool focus) {
|
|||
if (m && focus)
|
||||
focusclient(focustop(m), 1);
|
||||
|
||||
if (!c->foreign_toplevel && m) {
|
||||
if (m) {
|
||||
|
||||
if (c->foreign_toplevel) {
|
||||
remove_foreign_topleve(c);
|
||||
}
|
||||
|
||||
add_foreign_toplevel(c);
|
||||
if (m->sel && m->sel->foreign_toplevel)
|
||||
wlr_foreign_toplevel_handle_v1_set_activated(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue