fix: apply named scratch size fail

This commit is contained in:
DreamMaoMao 2025-09-05 18:45:47 +08:00
parent 03ce91572a
commit 7d15562c6e

View file

@ -900,11 +900,13 @@ void show_scratchpad(Client *c) {
/* return if fullscreen */ /* return if fullscreen */
if (!c->isfloating) { if (!c->isfloating) {
setfloating(c, 1); setfloating(c, 1);
c->geom.width = c->scratchpad_width c->geom.width = c->scratchpad_width ? c->scratchpad_width
? c->scratchpad_width : c->oldgeom.width
? c->oldgeom.width
: c->mon->w.width * scratchpad_width_ratio; : c->mon->w.width * scratchpad_width_ratio;
c->geom.height = c->scratchpad_height c->geom.height = c->scratchpad_height ? c->scratchpad_height
? c->scratchpad_height : c->oldgeom.height
? c->oldgeom.height
: c->mon->w.height * scratchpad_height_ratio; : c->mon->w.height * scratchpad_height_ratio;
// 重新计算居中的坐标 // 重新计算居中的坐标
c->oldgeom = c->geom = c->animainit_geom = c->animation.current = c->oldgeom = c->geom = c->animainit_geom = c->animation.current =
@ -1164,6 +1166,10 @@ void applyrules(Client *c) {
} }
} }
if (c->isnamedscratchpad) {
c->isfloating = 1;
}
// set geometry of floating client // set geometry of floating client
if (c->isfloating) { if (c->isfloating) {
if (r->width > 0) if (r->width > 0)
@ -1213,12 +1219,6 @@ void applyrules(Client *c) {
} }
} }
// set mon and floating, fullscreen and scratchpad state
if (c->isnamedscratchpad) {
c->isfloating = 1;
}
int fullscreen_state_backup = c->isfullscreen || client_wants_fullscreen(c); int fullscreen_state_backup = c->isfullscreen || client_wants_fullscreen(c);
setmon(c, mon, newtags, setmon(c, mon, newtags,
!c->isopensilent && (!c->istagsilent || !newtags || !c->isopensilent && (!c->istagsilent || !newtags ||