#649523 ratpoison: Please include program compiled from example sloppy.c

Package:
ratpoison
Source:
ratpoison
Description:
keyboard-only window manager
Submitter:
Axel Beckert
Date:
2011-11-21 23:21:06 UTC
Severity:
wishlist
#649523#5
Date:
2011-11-21 21:45:32 UTC
From:
To:
Hi Bernhard,

the ratpoison source package contains a C code example called sloppy.c
in the contrib directory. It is currently installed to
/usr/share/doc/ratpoison/examples/sloppy.ch in the Debian binary
package.

Please include the program compiled from that example in the package,
too, e.g. as /usr/bin/unrat like the comments in the code suggest.

#649523#10
Date:
2011-11-21 21:57:49 UTC
From:
To:
Hi again,

Axel Beckert wrote:

Well, unrat seems to be another example program in that directory on
which sloppy is based on as it still refers to it in the source code
comments.

So the binary is probably best called sloppy (no name clash found in
neither Squeeze nor Sid) or maybe even better ratpoison-sloppy (less
ambiguous).

		Regards, Axel

#649523#15
Date:
2011-11-21 23:17:39 UTC
From:
To:
Hi Bernhard,

Axel Beckert wrote:

I suggest the following modification to sloppy.c which prevents a
race-condition between sloppy and the window switch with C-t C-t by
checking the frame id of the to be selected window with the until then
selected frame.

Additionally it suppresses the error messages "not enough arguments"
if awk doesn't output something and therefore the select argument is
missing (on purpose, as in that case it should not select anything):
--- /usr/share/doc/ratpoison/examples/sloppy.c 2011-09-13 17:26:30.000000000 +0200 +++ sloppy.c 2011-11-22 00:03:44.000000000 +0100 @@ -90,7 +90,7 @@ /* A window was entered. select it. */ { char shell[256]; - snprintf (shell, 255, "$RATPOISON -c \"select `$RATPOISON -c 'windows %%i %%n' | grep '%ld' | awk '{print $2}'`\"", event.xcrossing.window); + snprintf (shell, 255, "$RATPOISON -c \"select $($RATPOISON -c 'windows %%i %%n %%f' | grep '%ld' | awk '$3 != '$($RATPOISON -c curframe)' && $3 != \"\" {print $2}')\" 2>/dev/null", event.xcrossing.window); //printf ("%s\n", shell); spawn (shell); wait (NULL); That way sloppy focus follows mouse works fine for me in ratpoison without any race-condition. (I suggest to propagate this patch to upstream, too.) Regards, Axel -- ,''`. | Axel Beckert <abe@debian.org>, http://people.debian.org/~abe/ : :' : | Debian Developer, ftp.ch.debian.org Admin `. `' | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE `- | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5