opt: Remove redundant code

This commit is contained in:
DreamMaoMao 2026-06-23 10:43:16 +08:00
parent 24af062672
commit 960846095f
3 changed files with 6 additions and 47 deletions

View file

@ -942,6 +942,7 @@ static void global_draw_group_bar(Client *c, int32_t x, int32_t y,
int32_t width, int32_t height);
static void client_reparent_group(Client *c);
static void client_change_mon(Client *c, Monitor *m);
#include "data/static_keymap.h"
#include "dispatch/bind_declare.h"
@ -2760,10 +2761,8 @@ void closemon(Monitor *m) {
c->foreign_toplevel = NULL;
}
c->mon = NULL;
client_set_group_mon(c, NULL);
} else {
client_change_mon(c, selmon);
client_set_group_mon(c, selmon);
}
// record the oldmonname which is used to restore
@ -3870,7 +3869,6 @@ void focusclient(Client *c, int32_t lift) {
/* Raise client in stacking order if requested */
if (c && lift) {
client_raise_group(c);
wlr_scene_node_raise_to_top(&c->scene->node); // 将视图提升到顶层
}
if (c && client_surface(c) == old_keyboard_focus_surface && selmon &&
@ -5549,15 +5547,6 @@ setfloating(Client *c, int32_t floating) {
}
}
if (c->isoverlay) {
wlr_scene_node_reparent(&c->scene->node, layers[LyrOverlay]);
} else if (client_should_overtop(c) && c->isfloating) {
wlr_scene_node_reparent(&c->scene->node, layers[LyrTop]);
} else {
wlr_scene_node_reparent(&c->scene->node,
layers[c->isfloating ? LyrTop : LyrTile]);
}
client_reparent_group(c);
if (c->isfloating) {
@ -5653,10 +5642,6 @@ void setmaximizescreen(Client *c, int32_t maximizescreen, bool rearrange) {
setfloating(c, 1);
}
wlr_scene_node_reparent(&c->scene->node,
layers[c->ismaximizescreen ? LyrMaximize
: c->isfloating ? LyrTop
: LyrTile]);
client_reparent_group(c);
if (!c->force_fakemaximize && !c->ismaximizescreen) {
@ -5717,16 +5702,6 @@ void setfullscreen(Client *c, int32_t fullscreen,
setfloating(c, 1);
}
if (c->isoverlay) {
wlr_scene_node_reparent(&c->scene->node, layers[LyrOverlay]);
} else if (client_should_overtop(c) && c->isfloating) {
wlr_scene_node_reparent(&c->scene->node, layers[LyrTop]);
} else {
wlr_scene_node_reparent(
&c->scene->node,
layers[fullscreen || c->isfloating ? LyrTop : LyrTile]);
}
client_reparent_group(c);
if (rearrange)