mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-15 22:05:20 -05:00
Fix: Prevent window overlap when killing a stacked client
When a client within a vertical stack was killed, the layout was not correctly updated, causing other windows to overlap. This commit modifies the pending_kill_client function to properly update the next_in_stack and prev_in_stack pointers of neighboring clients when a stacked client is killed. It also triggers an arrange call to refresh the layout, ensuring that windows no longer overlap and the remaining clients in the stack resize correctly.
This commit is contained in:
parent
d4a648372d
commit
660633bd1d
1 changed files with 21 additions and 1 deletions
22
src/mango.c
22
src/mango.c
|
|
@ -3638,7 +3638,27 @@ void keypressmod(struct wl_listener *listener, void *data) {
|
|||
}
|
||||
|
||||
void pending_kill_client(Client *c) {
|
||||
// c->iskilling = 1; //不可以提前标记已经杀掉,因为有些客户端可能拒绝
|
||||
if (!c || c->iskilling)
|
||||
return;
|
||||
|
||||
// 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;
|
||||
if (!c->prev_in_stack) { // c was the head of the stack
|
||||
// The next client becomes the new head, so we need to ensure it's treated as such.
|
||||
// This is implicitly handled by setting its prev_in_stack to NULL.
|
||||
}
|
||||
}
|
||||
c->prev_in_stack = NULL;
|
||||
c->next_in_stack = NULL;
|
||||
arrange(c->mon, false, false);
|
||||
}
|
||||
|
||||
c->iskilling = 1;
|
||||
client_send_close(c);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue