mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-10 23:50:41 -04:00
fix: foreign toplevel mon change
This commit is contained in:
parent
42c02e3dc2
commit
18fa5a22c2
3 changed files with 58 additions and 25 deletions
|
|
@ -1109,7 +1109,7 @@ int32_t tag(const Arg *arg) {
|
|||
}
|
||||
|
||||
int32_t tagmon(const Arg *arg) {
|
||||
Monitor *m = NULL, *cm = NULL;
|
||||
Monitor *m = NULL, *cm = NULL, *oldmon = NULL;
|
||||
if (!selmon)
|
||||
return 0;
|
||||
Client *c = focustop(selmon);
|
||||
|
|
@ -1117,6 +1117,8 @@ int32_t tagmon(const Arg *arg) {
|
|||
if (!c)
|
||||
return 0;
|
||||
|
||||
oldmon = c->mon;
|
||||
|
||||
if (arg->i != UNDIR) {
|
||||
m = dirtomon(arg->i);
|
||||
} else if (arg->v) {
|
||||
|
|
@ -1151,12 +1153,12 @@ int32_t tagmon(const Arg *arg) {
|
|||
setmon(c, m, newtags, true);
|
||||
client_update_oldmonname_record(c, m);
|
||||
|
||||
reset_foreign_tolevel(c);
|
||||
reset_foreign_tolevel(c, oldmon, c->mon);
|
||||
|
||||
c->float_geom.width =
|
||||
(int32_t)(c->float_geom.width * c->mon->w.width / selmon->w.width);
|
||||
(int32_t)(c->float_geom.width * c->mon->w.width / oldmon->w.width);
|
||||
c->float_geom.height =
|
||||
(int32_t)(c->float_geom.height * c->mon->w.height / selmon->w.height);
|
||||
(int32_t)(c->float_geom.height * c->mon->w.height / oldmon->w.height);
|
||||
selmon = c->mon;
|
||||
c->float_geom = setclient_coordinate_center(c, c->mon, c->float_geom, 0, 0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue