opt: remove useless code

This commit is contained in:
DreamMaoMao 2026-01-17 12:34:35 +08:00
parent 810933cbf8
commit 598731f573
3 changed files with 6 additions and 28 deletions

View file

@ -429,9 +429,7 @@ int32_t resizewin(const Arg *arg) {
Client *target_client = c;
if (is_scroller_layout(c->mon) &&
(c->prev_in_stack || c->next_in_stack)) {
while (target_client->prev_in_stack) {
target_client = target_client->prev_in_stack;
}
target_client = get_scroll_stack_head(target_client);
}
switch (arg->ui) {
case NUM_TYPE_MINUS:
@ -1636,20 +1634,10 @@ int32_t scroller_unstack(const Arg *arg) {
}
Client *scroller_stack_head = c;
while (scroller_stack_head->prev_in_stack) {
scroller_stack_head = scroller_stack_head->prev_in_stack;
}
scroller_stack_head = get_scroll_stack_head(scroller_stack_head);
// Remove c from its current stack
if (c->prev_in_stack) {
c->prev_in_stack->next_in_stack = c->next_in_stack;
}
if (c->next_in_stack) {
c->next_in_stack->prev_in_stack = c->prev_in_stack;
}
c->next_in_stack = NULL;
c->prev_in_stack = NULL;
exit_scroller_stack(c);
// Insert c after the stack it was in
wl_list_remove(&c->link);

View file

@ -314,9 +314,7 @@ void scroller(Monitor *m) {
// root_client might be in a stack, find the stack head
if (root_client) {
while (root_client->prev_in_stack) {
root_client = root_client->prev_in_stack;
}
root_client = get_scroll_stack_head(root_client);
}
if (!root_client) {

View file

@ -767,6 +767,7 @@ static void request_fresh_all_monitors(void);
static Client *find_client_by_direction(Client *tc, const Arg *arg,
bool findfloating, bool ignore_align);
static void exit_scroller_stack(Client *c);
static Client *get_scroll_stack_head(Client *c);
#include "data/static_keymap.h"
#include "dispatch/bind_declare.h"
@ -5470,16 +5471,7 @@ void unmapnotify(struct wl_listener *listener, void *data) {
init_fadeout_client(c);
// If the client is in a stack, remove it from the stack
if (c->prev_in_stack || c->next_in_stack) {
if (c->prev_in_stack) {
c->prev_in_stack->next_in_stack = c->next_in_stack;
}
if (c->next_in_stack) {
c->next_in_stack->prev_in_stack = c->prev_in_stack;
}
c->prev_in_stack = NULL;
c->next_in_stack = NULL;
}
exit_scroller_stack(c);
if (c->swallowedby) {
c->swallowedby->mon = c->mon;