mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-06 13:29:53 -05:00
opt: remeber custom floating size for scratch window
This commit is contained in:
parent
aa5468d44d
commit
bf6e39ad4f
1 changed files with 11 additions and 0 deletions
11
src/maomao.c
11
src/maomao.c
|
|
@ -1325,6 +1325,12 @@ void show_scratchpad(Client *c) {
|
|||
c->ismaxmizescreen = 0;
|
||||
c->bw = borderpx; // 恢复非全屏的border
|
||||
}
|
||||
|
||||
if(c->oldgeom.width)
|
||||
c->scratch_geom.width = c->oldgeom.width;
|
||||
if(c->oldgeom.height)
|
||||
c->scratch_geom.height = c->oldgeom.height;
|
||||
|
||||
/* return if fullscreen */
|
||||
if (!c->isfloating) {
|
||||
setfloating(c, 1);
|
||||
|
|
@ -1333,6 +1339,11 @@ void show_scratchpad(Client *c) {
|
|||
// 重新计算居中的坐标
|
||||
c->geom = c->animainit_geom = c->animation.current = setclient_coordinate_center(c->geom, 0, 0);
|
||||
resize(c, c->geom, 0);
|
||||
} else if(c->geom.width != c->scratch_geom.width || c->geom.height != c->scratch_geom.height) {
|
||||
c->geom.width = c->scratch_geom.width ? c->scratch_geom.width: c->mon->w.width * 0.7;
|
||||
c->geom.height = c->scratch_geom.height? c->scratch_geom.height : c->mon->w.height * 0.8;
|
||||
c->geom = c->animainit_geom = c->animation.current = setclient_coordinate_center(c->geom, 0, 0);
|
||||
resize(c, c->geom, 0);
|
||||
}
|
||||
c->oldtags = selmon->tagset[selmon->seltags];
|
||||
show_hide_client(c);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue