[hackers] [quark][PATCH 2/7] arg.h: more readable NULL pointer

2021-07-04 Thread Nikita Zlobin
--- arg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arg.h b/arg.h index 5444aad..d983ebf 100644 --- a/arg.h +++ b/arg.h @@ -22,7 +22,7 @@ extern char *argv0; /* int main(int argc, char *argv[]) */ -#define ARGBEGIN for (argv0 = *argv, *argv ? (argc--, argv++) :

[hackers] [quark][PATCH 5/7] arg.h: uncluttering

2021-07-04 Thread Nikita Zlobin
--- arg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arg.h b/arg.h index 1c2757f..47d4afb 100644 --- a/arg.h +++ b/arg.h @@ -45,9 +45,9 @@ extern char *argv0; } \ }

[hackers] [quark][PATCH 6/7] arg.h: unconditional break

2021-07-04 Thread Nikita Zlobin
--- arg.h | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arg.h b/arg.h index 47d4afb..d565126 100644 --- a/arg.h +++ b/arg.h @@ -35,12 +35,9 @@ extern char *argv0; switch((*argv)[i_]) #define ARGEND if (argused_) {

Re: [hackers] [st][PATCH] arg.h: optimize & style

2021-07-04 Thread Nikita Zlobin
In Sun, 4 Jul 2021 12:34:54 +0200 Laslo Hunhold wrote: > the arg.h in st has some "low-hanging" fruits regarding improvements, > and I modified it accordingly in quark and farbfeld back in 2017 (see > [0]) to fix some issues. > > One example is that in my modified form, you can actually access

[hackers] [quark][PATCH 1/7] arg.h: visual separation for blocks

2021-07-04 Thread Nikita Zlobin
- multiline declaration needs clear separation from body - ARGBEGIN & ARGEND are slightly like contiguous without empty line --- arg.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arg.h b/arg.h index 35cc7cc..5444aad 100644 --- a/arg.h +++ b/arg.h @@ -23,7 +23,8 @@

[hackers] [quark][PATCH 4/7] arg.h: clean ref for argv[1] element

2021-07-04 Thread Nikita Zlobin
--- arg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arg.h b/arg.h index ba3e34a..1c2757f 100644 --- a/arg.h +++ b/arg.h @@ -46,7 +46,7 @@ extern char *argv0; } #define ARGC() ((*argv)[i_]) #define ARGF_(x) (((*argv)[i_ + 1]) ? (argused_ = 1,

[hackers] [quark][PATCH 7/7] arg.h: pointer iterator for opt letters

2021-07-04 Thread Nikita Zlobin
--- arg.h | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/arg.h b/arg.h index d565126..5e9de7c 100644 --- a/arg.h +++ b/arg.h @@ -26,24 +26,25 @@ extern char *argv0; *argv && (*argv)[0] == '-' && (*argv)[1]; \

[hackers] [quark][PATCH 3/7] arg.h: more consistency in outer loop declaration

2021-07-04 Thread Nikita Zlobin
--- arg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arg.h b/arg.h index d983ebf..ba3e34a 100644 --- a/arg.h +++ b/arg.h @@ -23,7 +23,8 @@ extern char *argv0; /* int main(int argc, char *argv[]) */ #define ARGBEGIN for (argv0 = *argv, *argv ? (argc--, argv++) :

Re: [hackers] [st][PATCH] arg.h: optimize & style

2021-07-04 Thread Nikita Zlobin
In Sun, 4 Jul 2021 11:55:53 +0200 Hiltjo Posthuma wrote: > Hi, > > Thanks, but I prefer the current style one. > > I'm not confident this patch doesn't modify any behaviour. > For example I see the `i` variable was removed, but it is actually > important to not modify argv as this causes

Re: [hackers] [st][PATCH] arg.h: optimize & style

2021-07-04 Thread Nikita Zlobin
В Sun, 4 Jul 2021 11:55:53 +0200 Hiltjo Posthuma пишет: > On Sun, Jul 04, 2021 at 12:30:27PM +0500, Nikita Zlobin wrote: > > - improved code readability > > - cleaned redundant variables and checks > > - isolated reusable part for (E)ARGF &g

Re: [hackers] [st][PATCH] arg.h: optimize & style

2021-07-04 Thread Nikita Zlobin
In Sun, 4 Jul 2021 11:55:53 +0200 Hiltjo Posthuma wrote: > On Sun, Jul 04, 2021 at 12:30:27PM +0500, Nikita Zlobin wrote: > > - improved code readability > > - cleaned redundant variables and checks > > - isolated reusable part for (E)ARGF &g

[hackers] [st][PATCH] arg.h: optimize & style

2021-07-04 Thread Nikita Zlobin
- improved code readability - cleaned redundant variables and checks - isolated reusable part for (E)ARGF --- arg.h | 65 +-- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/arg.h b/arg.h index a22e019..ee0bbc6 100644 ---

[hackers] [tabbed][PATCH] arg.h: optimization

2021-07-03 Thread Nikita Zlobin
--- arg.h | 37 ++--- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/arg.h b/arg.h index ac5824e..ee0bbc6 100644 --- a/arg.h +++ b/arg.h @@ -14,8 +14,7 @@ extern char *argv0; argv[0] && argv[0][0] == '-' && argv[0][1];

[hackers] [tabbed][PATCH] arg.h: optimization

2021-07-03 Thread Nikita Zlobin
- option argument functions are almost same, differing in one line - renamed argc_ to arg_ to clear difference - no need in argv_ comparison, since brk_ is set anyway - deduplicated same calculation --- arg.h | 37 ++--- 1 file changed, 14 insertions(+), 23

[hackers] [tabbed][PATCH] Update client name on _NET_WM_TITLE change too

2020-06-13 Thread Nikita Zlobin
I got problem with xterm, though not urxvt - when title randomly was not updated. By some reason sometimes WM_NAME prop event doesn't accompany one for _NET_WM_NAME, despite its changed, thus missing update. One nasty issue here - next update will supply previous name, though eventually gives

[hackers] [tabbed][PATCH] Correct encodign detection for window properties

2020-06-13 Thread Nikita Zlobin
Replacement for previous "Use utf8 for window properties". Simple replacement of Xmb with Xutf8 stuff was too naive, since certain xprop names have standartized type. For WM_NAME it's compound, not utf. This patch adds more string type atoms from Xmu, as previous version did not expect anything

Re: [hackers] [tabbed][PATCH] Use PWD xprop to set workdir for spawned clients

2020-06-12 Thread Nikita Zlobin
In Thu, 11 Jun 2020 22:14:31 +0200 Hiltjo Posthuma wrote: > On Thu, Jun 11, 2020 at 01:56:21PM +0500, Nikita Zlobin wrote: > > workdir could be got from active client via xprop, then set for > > spawned client. Terminals can pass it with xprop -id ${WINDOWID} > > comma

[hackers] [tabbed][PATCH] More effective mass-unmanage in cleanup

2020-06-12 Thread Nikita Zlobin
Better version of BadDrawable fix patch. Workaround or not - it did the fix, though still was not enough complete. I changed cleanup() to mass-unmanage clients in more effective way, without per-client unmanage(), leading to focus and memory tinkering. Current cleanup() doesn't expect unmanage()

[hackers] [tabbed][PATCH] Use PWD xprop to set workdir for spawned clients

2020-06-11 Thread Nikita Zlobin
workdir could be got from active client via xprop, then set for spawned client. Terminals can pass it with xprop -id ${WINDOWID} command from hook, created for PWD change. Setting up hook depends on what shell is used. For bash it's doable either via cd() function or PROMPT_COMMAND. Example bash

[hackers] [tabbed][PATCH] Fix clients blinking on tabbar cleanup

2020-06-11 Thread Nikita Zlobin
If tabbar had many windows, when closed itself, reparented clients may occasionally appear on their own for moment before to disappear. Unmapping before reparent seems to fix this. And killclient() by index if possible to avoid tinker with focus. --- tabbed.c | 27 +-- 1

[hackers] [tabbed][PATCH] Use utf8 for window properties

2020-06-11 Thread Nikita Zlobin
At least some desktop tools (non-mainstream) are in trouble with tabbed window name. At the moment of try I have only tint2 and rofi. First just showes intitled, but second - "Invalid encoding". Though xfwm4 has no problem with compound text names. As for other properties - utf8 still looks

Re: [hackers] [tabbed][PATCH] Use utf8 for window name

2020-06-11 Thread Nikita Zlobin
In Thu, 11 Jun 2020 08:47:09 +0200 Laslo Hunhold wrote: > On Thu, 11 Jun 2020 11:42:40 +0500 > Nikita Zlobin wrote: > > Dear Nikita, > > > One more reason to propose utf. I have read this to better > > understand Xft: https://keithp.com/~keithp/talks/xtc2001

Re: [hackers] [tabbed][PATCH] Use utf8 for window name

2020-06-11 Thread Nikita Zlobin
In Wed, 10 Jun 2020 22:09:01 +0200 Hiltjo Posthuma wrote: > On Thu, Jun 04, 2020 at 02:13:49PM +0500, Nikita Zlobin wrote: > > At least some desktop tools (non-mainstream) are in trouble with > > tabbed window name. At the moment of try I have only tint2 and > > rofi. First

Re: [hackers] [tabbed][PATCH] Use utf8 for window name

2020-06-10 Thread Nikita Zlobin
In Wed, 10 Jun 2020 22:09:01 +0200 Hiltjo Posthuma wrote: > On Thu, Jun 04, 2020 at 02:13:49PM +0500, Nikita Zlobin wrote: > > At least some desktop tools (non-mainstream) are in trouble with > > tabbed window name. At the moment of try I have only tint2 and > > rofi. First

Re: [hackers] [tabbed][PATCH] Fix clients BadDrawable at cleanup with multiple tabs

2020-06-10 Thread Nikita Zlobin
In Wed, 10 Jun 2020 22:10:02 +0200 Hiltjo Posthuma wrote: > On Thu, Jun 04, 2020 at 04:01:17PM +0500, Nikita Zlobin wrote: > > unmanage() after killclient() causes at least one BadDrawable from > > client. For urxvtd it can crash entire daemon. > > --- > > tabbed.c |

What about other patches (Re: [hackers] [tabbed][PATCH] Use PWD xprop to set workdir for spawned clients)

2020-06-10 Thread Nikita Zlobin
In Thu, 4 Jun 2020 16:21:40 -0400 Daniel Moch wrote: > On Thu, Jun 04, 2020 at 11:26:15AM +0500, Nikita Zlobin wrote: > > Somewhat disconvenient after true multitab terminals, that new term > > tabs don't inherit workdir from previous active. Here is some > > attempt to make

Re: [hackers] [tabbed][PATCH] Use PWD xprop to set workdir for spawned clients

2020-06-05 Thread Nikita Zlobin
In Thu, 4 Jun 2020 16:21:40 -0400 Daniel Moch wrote: > On Thu, Jun 04, 2020 at 11:26:15AM +0500, Nikita Zlobin wrote: > > Somewhat disconvenient after true multitab terminals, that new term > > tabs don't inherit workdir from previous active. Here is some > > attempt to make

Re: [hackers] [tabbed][PATCH] Use PWD xprop to set workdir for spawned clients

2020-06-04 Thread Nikita Zlobin
In Thu, 4 Jun 2020 16:21:40 -0400 Daniel Moch wrote: > On Thu, Jun 04, 2020 at 11:26:15AM +0500, Nikita Zlobin wrote: > > Somewhat disconvenient after true multitab terminals, that new term > > tabs don't inherit workdir from previous active. Here is some > > attempt to make

[hackers] [tabbed][PATCH] Fix clients BadDrawable at cleanup with multiple tabs

2020-06-04 Thread Nikita Zlobin
unmanage() after killclient() causes at least one BadDrawable from client. For urxvtd it can crash entire daemon. --- tabbed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tabbed.c b/tabbed.c index 4ee4277..6b53d94 100644 --- a/tabbed.c +++ b/tabbed.c @@ -219,10 +219,10 @@

[hackers] [tabbed][PATCH] Use PWD xprop to set workdir for spawned clients

2020-06-04 Thread Nikita Zlobin
workdir could be got from active client via xprop, then set for spawned client. Terminals can pass it with xprop -id ${WINDOWID} command from hook, created for PWD change. Setting up hook depends on what shell is used. For bash it's doable either via cd() function or PROMPT_COMMAND. Example bash

[hackers] [tabbed][PATCH] Use utf8 for window name

2020-06-04 Thread Nikita Zlobin
At least some desktop tools (non-mainstream) are in trouble with tabbed window name. At the moment of try I have only tint2 and rofi. First just showes intitled, but second - "Invalid encoding". Though xfwm4 has no problem with compound text names. --- tabbed.c | 4 ++-- 1 file changed, 2

[hackers] [tabbed][PATCH] Use utf8 for window name

2020-06-04 Thread Nikita Zlobin
17 00:00:00 2001 From: Nikita Zlobin Date: Thu, 4 Jun 2020 13:04:22 +0500 Subject: [tabbed][PATCH] Use utf8 for window name To: hackers@suckless.org At least some desktop tools (non-mainstream) are in trouble with tabbed window name. At the moment of try I have only tint2 and rofi. First just

[hackers] [tabbed][PATCH] Use PWD xprop to set workdir for spawned clients

2020-06-03 Thread Nikita Zlobin
and strcpy. >From a775618bb892f7cd111bc35339a304149195a411 Mon Sep 17 00:00:00 2001 From: Nikita Zlobin Date: Thu, 4 Jun 2020 00:58:35 +0500 Subject: [tabbed][PATCH] Use PWD xprop to set workdir for spawned clients To: hackers@suckless.org workdir could be got from active client via xprop, then