fixed tab responding under marukuru

This commit is contained in:
WanderingPenwing 2024-08-14 18:23:35 +02:00
parent 276fe8e8ed
commit 98beb2bfa1

11
surf.c
View file

@ -154,6 +154,7 @@ typedef struct Client {
GtkWidget *tab_bar;
int tab_click_index;
bool tab_drag;
pid_t subprocess_pid;
} Client;
typedef struct {
@ -651,6 +652,13 @@ void tab_bar_click(Client *c, bool close) {
return;
}
int status;
pid_t result = waitpid(c->subprocess_pid, &status, WNOHANG);
if (result == 0 && c->subprocess_pid != 0) {
return;
}
if (close) {
Arg close_arg = {.i = c->tab_click_index};
close_tab(c, &close_arg);
@ -1556,7 +1564,8 @@ newwindow(Client *c, const Arg *a, int noembed)
void
spawn(Client *c, const Arg *a)
{
if (fork() == 0) {
c->subprocess_pid = fork();
if (c->subprocess_pid == 0) {
if (dpy)
close(ConnectionNumber(dpy));
close(spair[0]);