Debian Bug report logs - #649523
ratpoison: Please include program compiled from example sloppy.c

version graph

Package: ratpoison; Maintainer for ratpoison is Bernhard R. Link <brlink@debian.org>; Source for ratpoison is src:ratpoison (PTS, buildd, popcon).

Reported by: Axel Beckert <abe@debian.org>

Date: Mon, 21 Nov 2011 21:48:08 UTC

Severity: wishlist

Found in version ratpoison/1.4.5-3

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, abe@debian.org, Bernhard R. Link <brlink@debian.org>:
Bug#649523; Package ratpoison. (Mon, 21 Nov 2011 21:48:11 GMT) (full text, mbox, link).


Acknowledgement sent to Axel Beckert <abe@debian.org>:
New Bug report received and forwarded. Copy sent to abe@debian.org, Bernhard R. Link <brlink@debian.org>. (Mon, 21 Nov 2011 21:48:12 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Axel Beckert <abe@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: ratpoison: Please include program compiled from example sloppy.c
Date: Mon, 21 Nov 2011 22:45:32 +0100
Package: ratpoison
Version: 1.4.5-3
Severity: wishlist

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.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (900, 'testing'), (600, 'stable'), (400, 'oldstable'), (110, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.1.0-1-686-pae (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ratpoison depends on:
ii  dpkg          1.16.1.1      
ii  install-info  4.13a.dfsg.1-8
ii  libc6         2.13-21       
ii  libx11-6      2:1.4.4-4     
ii  libxft2       2.2.0-3       
ii  libxinerama1  2:1.1.1-3     
ii  libxtst6      2:1.2.0-4     

Versions of packages ratpoison recommends:
ii  9menu                                        <none>   
ii  menu                                         2.1.46   
ii  rxvt-unicode-256color [x-terminal-emulator]  9.12-1+b1
ii  xterm [x-terminal-emulator]                  276-1    

Versions of packages ratpoison suggests:
ii  xbindkeys  <none>
ii  xclip      0.12-1

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Bernhard R. Link <brlink@debian.org>:
Bug#649523; Package ratpoison. (Mon, 21 Nov 2011 22:00:16 GMT) (full text, mbox, link).


Acknowledgement sent to Axel Beckert <abe@debian.org>:
Extra info received and forwarded to list. Copy sent to Bernhard R. Link <brlink@debian.org>. (Mon, 21 Nov 2011 22:00:16 GMT) (full text, mbox, link).


Message #10 received at 649523@bugs.debian.org (full text, mbox, reply):

From: Axel Beckert <abe@debian.org>
To: 649523@bugs.debian.org
Subject: Re: Bug#649523: ratpoison: Please include program compiled from example sloppy.c
Date: Mon, 21 Nov 2011 22:57:49 +0100
Hi again,

Axel Beckert wrote:
> 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.

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
-- 
 ,''`.  |  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




Information forwarded to debian-bugs-dist@lists.debian.org, Bernhard R. Link <brlink@debian.org>:
Bug#649523; Package ratpoison. (Mon, 21 Nov 2011 23:21:06 GMT) (full text, mbox, link).


Acknowledgement sent to Axel Beckert <abe@debian.org>:
Extra info received and forwarded to list. Copy sent to Bernhard R. Link <brlink@debian.org>. (Mon, 21 Nov 2011 23:21:06 GMT) (full text, mbox, link).


Message #15 received at 649523@bugs.debian.org (full text, mbox, reply):

From: Axel Beckert <abe@debian.org>
To: 649523@bugs.debian.org
Subject: Re: Bug#649523: ratpoison: Please include program compiled from example sloppy.c (Patch for sloppy.c to prevent race-condition)
Date: Tue, 22 Nov 2011 00:17:39 +0100
Hi Bernhard,

Axel Beckert wrote:
> Please include the program compiled from that example in the package,
> too, [...]

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




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Dec 6 16:36:33 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.