From 491e29fefabd59f9fe2f956cd227224d9b161ea8 Mon Sep 17 00:00:00 2001 From: Venelin Date: Thu, 11 Jul 2024 21:11:53 +0300 Subject: [PATCH] vene fix notify window while its visible --- config.h | 4 ++-- dwm.c | 10 +++++++--- vene.cpp | 10 +++++----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/config.h b/config.h index 71d6dc9..151ffbc 100644 --- a/config.h +++ b/config.h @@ -18,8 +18,8 @@ static const char col_gray4[] = "#eeeeee"; static const char col_cyan[] = "#005577"; static const char* colors[][3] = { /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, + [SchemeNorm] = { col_gray3, col_gray1, "#000000" }, + [SchemeSel] = { col_gray4, col_cyan, "#FFFF00" }, }; /* tagging */ diff --git a/dwm.c b/dwm.c index b99cc48..b222cc9 100644 --- a/dwm.c +++ b/dwm.c @@ -224,7 +224,7 @@ void updatestatus(void); static void updatetitle(Client *c); static void updatewindowtype(Client *c); static void updatewmhints(Client *c); -void view(const Arg *arg); +static void view(const Arg *arg); static Client *wintoclient(Window w); static Monitor *wintomon(Window w); static int xerror(Display *dpy, XErrorEvent *ee); @@ -527,8 +527,12 @@ clientmessage(XEvent *e) if (c != selmon->sel && !c->isurgent) seturgent(c, 1); - const Arg tag = {.ui = c->tags}; /* switch to show highlighted window*/ - view(&tag); + if( !ISVISIBLE(c) ) + { + const Arg tag = {.ui = c->tags}; /* switch to show highlighted window */ + view(&tag); + // Todo: c->tags can be multiple tags + } } } diff --git a/vene.cpp b/vene.cpp index b5733aa..2d46ada 100644 --- a/vene.cpp +++ b/vene.cpp @@ -105,17 +105,17 @@ extern "C" time_point now = system_clock::now(); if(has_child && check_exited(child)) { - // Clean up all zombies - while (waitpid(-1, nullptr, WNOHANG) > 0); - has_child = false; updatestatus(); - next_update = now + 5s; + next_update = now + 10s; } else if(now > next_update) { + // Clean up all zombies + while (waitpid(-1, nullptr, WNOHANG) > 0); + updatestatus(); - next_update = now + 5s; + next_update = now + 10s; } }