mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-15 08:21:41 -04:00
opt: remove useless code
This commit is contained in:
parent
810933cbf8
commit
598731f573
3 changed files with 6 additions and 28 deletions
|
|
@ -429,9 +429,7 @@ int32_t resizewin(const Arg *arg) {
|
||||||
Client *target_client = c;
|
Client *target_client = c;
|
||||||
if (is_scroller_layout(c->mon) &&
|
if (is_scroller_layout(c->mon) &&
|
||||||
(c->prev_in_stack || c->next_in_stack)) {
|
(c->prev_in_stack || c->next_in_stack)) {
|
||||||
while (target_client->prev_in_stack) {
|
target_client = get_scroll_stack_head(target_client);
|
||||||
target_client = target_client->prev_in_stack;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
switch (arg->ui) {
|
switch (arg->ui) {
|
||||||
case NUM_TYPE_MINUS:
|
case NUM_TYPE_MINUS:
|
||||||
|
|
@ -1636,20 +1634,10 @@ int32_t scroller_unstack(const Arg *arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *scroller_stack_head = c;
|
Client *scroller_stack_head = c;
|
||||||
while (scroller_stack_head->prev_in_stack) {
|
scroller_stack_head = get_scroll_stack_head(scroller_stack_head);
|
||||||
scroller_stack_head = scroller_stack_head->prev_in_stack;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove c from its current stack
|
// Remove c from its current stack
|
||||||
if (c->prev_in_stack) {
|
exit_scroller_stack(c);
|
||||||
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;
|
|
||||||
|
|
||||||
// Insert c after the stack it was in
|
// Insert c after the stack it was in
|
||||||
wl_list_remove(&c->link);
|
wl_list_remove(&c->link);
|
||||||
|
|
|
||||||
|
|
@ -314,9 +314,7 @@ void scroller(Monitor *m) {
|
||||||
|
|
||||||
// root_client might be in a stack, find the stack head
|
// root_client might be in a stack, find the stack head
|
||||||
if (root_client) {
|
if (root_client) {
|
||||||
while (root_client->prev_in_stack) {
|
root_client = get_scroll_stack_head(root_client);
|
||||||
root_client = root_client->prev_in_stack;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!root_client) {
|
if (!root_client) {
|
||||||
|
|
|
||||||
12
src/mango.c
12
src/mango.c
|
|
@ -767,6 +767,7 @@ static void request_fresh_all_monitors(void);
|
||||||
static Client *find_client_by_direction(Client *tc, const Arg *arg,
|
static Client *find_client_by_direction(Client *tc, const Arg *arg,
|
||||||
bool findfloating, bool ignore_align);
|
bool findfloating, bool ignore_align);
|
||||||
static void exit_scroller_stack(Client *c);
|
static void exit_scroller_stack(Client *c);
|
||||||
|
static Client *get_scroll_stack_head(Client *c);
|
||||||
|
|
||||||
#include "data/static_keymap.h"
|
#include "data/static_keymap.h"
|
||||||
#include "dispatch/bind_declare.h"
|
#include "dispatch/bind_declare.h"
|
||||||
|
|
@ -5470,16 +5471,7 @@ void unmapnotify(struct wl_listener *listener, void *data) {
|
||||||
init_fadeout_client(c);
|
init_fadeout_client(c);
|
||||||
|
|
||||||
// If the client is in a stack, remove it from the stack
|
// If the client is in a stack, remove it from the stack
|
||||||
if (c->prev_in_stack || c->next_in_stack) {
|
exit_scroller_stack(c);
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (c->swallowedby) {
|
if (c->swallowedby) {
|
||||||
c->swallowedby->mon = c->mon;
|
c->swallowedby->mon = c->mon;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue