chore: update c files
This commit is contained in:
parent
beda6ec573
commit
ab47f3c117
22
src/client.c
22
src/client.c
@ -361,6 +361,9 @@ void client_focus(Client *client)
|
||||
|
||||
client_raise(client);
|
||||
|
||||
/* Ungrab buttons so the application receives events directly */
|
||||
XUngrabButton(dwn->display, Button1, AnyModifier, client->window);
|
||||
|
||||
client_sync_log("client_focus: decorations");
|
||||
|
||||
decorations_render(client, true);
|
||||
@ -379,6 +382,12 @@ void client_unfocus(Client *client)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Grab buttons to intercept clicks for focus */
|
||||
if (dwn != NULL && dwn->display != NULL && client->window != None) {
|
||||
XGrabButton(dwn->display, Button1, AnyModifier, client->window, False,
|
||||
ButtonPressMask, GrabModeSync, GrabModeAsync, None, None);
|
||||
}
|
||||
|
||||
decorations_render(client, false);
|
||||
}
|
||||
|
||||
@ -428,6 +437,18 @@ void client_minimize(Client *client)
|
||||
|
||||
client->flags |= CLIENT_MINIMIZED;
|
||||
client_hide(client);
|
||||
|
||||
Workspace *ws = workspace_get(client->workspace);
|
||||
if (ws != NULL && ws->focused == client) {
|
||||
Client *next = workspace_mru_get_previous(client->workspace, client);
|
||||
if (next != NULL) {
|
||||
client_focus(next);
|
||||
} else {
|
||||
ws->focused = NULL;
|
||||
XSetInputFocus(dwn->display, dwn->root, RevertToPointerRoot, CurrentTime);
|
||||
atoms_set_active_window(None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void client_restore(Client *client)
|
||||
@ -749,6 +770,7 @@ void client_set_maximize(Client *client, bool maximized)
|
||||
client_configure(client);
|
||||
decorations_render(client, true);
|
||||
client_raise(client);
|
||||
client_focus(client);
|
||||
} else {
|
||||
client->flags &= ~CLIENT_MAXIMIZED;
|
||||
|
||||
|
||||
@ -302,7 +302,7 @@ void decorations_button_press(Client *client, ButtonType button)
|
||||
|
||||
case BUTTON_MAXIMIZE:
|
||||
LOG_DEBUG("Maximize button pressed for %s", client->title);
|
||||
client_toggle_fullscreen(client);
|
||||
client_toggle_maximize(client);
|
||||
break;
|
||||
|
||||
case BUTTON_MINIMIZE:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user