[RP] Program stealing focus when clicked

2016-07-15 Thread Will Storey
Hello, I have a program that steals my keyboard focus when I click inside it. I've found most programs don't do this, so this one doing so threw me off. I prefer to change focus through ratpoison. I looked into it a bit and created a patch that stops it happening. I am not sure what I came up wit

[RP] [PATCH 1/3] Limit width of formatted text by characters rather than bytes

2017-08-27 Thread Will Storey
When formatting text for display in the window list, it is possible to specify a limit to truncate at. This is useful for example with %t when you have a long title in the window. The prior implementation truncated counting by bytes. This was problematic if the limit happened to be in the middle o

[RP] [PATCH 2/3] Move several functions out of main.c into globals.c

2017-08-27 Thread Will Storey
These functions are used in many parts of ratpoison. In order to compile a separate program using the ratpoison files, we need them available outside of main.c. I want to create such a program for a set of unit tests. --- src/globals.c | 317 +

[RP] [PATCH 3/3] Add a test program to exercise concat_width()

2017-08-27 Thread Will Storey
This program can be run using `make check`. In order to do this, you will need to run `autogen.sh` again. --- .gitignore | 2 ++ src/Makefile.am | 11 +++ src/format.c| 92 + 3 files changed, 105 insertions(+) diff --git a/.git

Re: [RP] [PATCH 1/3] Limit width of formatted text by characters rather than bytes

2017-08-27 Thread Will Storey
Hi Spiros Thank you for looking at this! I'll send an updated patch. On Sun 2017-08-27 18:26:09 -0700, Spiros Bousbouras wrote: > > > static void > > concat_width (struct sbuf *buf, char *s, int width) > > I would turn this to const char *s Good idea. I'll add a few more const's too. > >

Re: [RP] [PATCH 3/3] Add a test program to exercise concat_width()

2017-08-27 Thread Will Storey
On Sun 2017-08-27 19:07:53 -0700, Spiros Bousbouras wrote: > > > +void __test_concat_width(void) > > Identifiers starting with __ are reserved for the C standard. A name like > rtp_test_concat_width seems fine to me. Interesting. I'll have to look that up! I'll send in an updated patch. Tha

[RP] [PATCH 1/3 v2] Limit width of formatted text by characters rather than bytes

2017-08-27 Thread Will Storey
When formatting text for display in the window list, it is possible to specify a limit to truncate at. This is useful for example with %t when you have a long title in the window. The prior implementation truncated counting by bytes. This was problematic if the limit happened to be in the middle o

[RP] [PATCH 3/3 v2] Add a test program to exercise concat_width()

2017-08-27 Thread Will Storey
This program can be run using `make check`. In order to do this, you will need to run `autogen.sh` again. --- .gitignore | 2 ++ src/Makefile.am | 11 +++ src/format.c| 100 3 files changed, 113 insertions(+) diff --git a/.g

Re: [RP] [PATCH 1/3 v2] Limit width of formatted text by characters rather than bytes

2017-08-29 Thread Will Storey
On Mon 2017-08-28 20:50:19 +0200, Jeremie Courreges-Anglas wrote: > > Hi Will, Hi! Thank you for looking at this. > First, thanks for your submission. You're dealing with a known problem. > > The direction taken so far in ratpoison was: don't deal with wide > characters, only handle UTF-8 in

Re: [RP] [PATCH 1/3 v2] Limit width of formatted text by characters rather than bytes

2017-09-18 Thread Will Storey
On Sun 2017-09-17 21:31:08 +0200, Jeremie Courreges-Anglas wrote: > Actually the behavior was rather incorrect. After my patch, > concat_width was copying up to 'width' bytes, not up to 'width' UTF-8 > characters. This gotcha was caught by your test case. I find the > latter behavior more useful

[RP] [PATCH] Add newlines to PRINT_DEBUG calls

2017-12-16 Thread Will Storey
There were a couple cases we did not end PRINT_DEBUG calls with newlines (barring intentional multi-line prints). --- src/input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/input.c b/src/input.c index c71d58c..db0e823 100644 --- a/src/input.c +++ b/src/input.c @@ -

[RP] [PATCH] Query for dimensions to apply to the screen when receiving an XRRCrtcChangeNotifyEvent

2017-12-16 Thread Will Storey
When receiving this event, we're told the dimensions of the CRTC. These dimensions apparently do not reflect the actual dimensions of the CRTC. This means ratpoison's knowledge of screen size can be inaccurate and ratpoison will use only a portion of the screen. This change makes us query for the

Re: [RP] patch to ignore resize hints

2018-05-12 Thread Will Storey
On Mon 2018-05-07 23:43:17 +, mujo wrote: > I wrote a patch to ignore resize hints so there would not be a gap > between my term windows and the frame. The patch also includes a > new setting to toggle this behaviour and changes to the manpage to > describe it. I've not fixed the info page beca