NetBSD Problem Report #22460

Received: (qmail 28543 invoked by uid 605); 12 Aug 2003 21:29:52 -0000
Message-Id: <m19mgiF-000B44C@proven.weird.com>
Date: Tue, 12 Aug 2003 17:29:51 -0400 (EDT)
From: woods@weird.com (Greg A. Woods)
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: woods@planix.com (Greg A. Woods)
To: gnats-bugs@gnats.netbsd.org
Subject: a fix for xconsole -notify to make it work like xterm -ziconbeep
X-Send-Pr-Version: 3.95

>Number:         22460
>Category:       xsrc
>Synopsis:       a fix for xconsole -notify to make it work like xterm -ziconbeep
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 12 21:30:00 +0000 2003
>Closed-Date:    
>Last-Modified:  
>Originator:     Greg A. Woods
>Release:        xsrc-20030810
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD
>Description:

	This patch fixes xconsole so that it behaves like Xterm with
	'-ziconbeep' -- i.e. so that it prepends three asterisks to its
	name instead of appending just one.

	This is useful for window managers which only show the first few
	characters of an icon name (such as ctwm with its SchrinkIconTitles)

>How-To-Repeat:

	use ctwm with SchrinkIconTitles and wonder why the xconsole icon
	never changes even when there's new output....

>Fix:

Index: xc/programs/xconsole/xconsole.man
===================================================================
RCS file: /cvs/master/m-NetBSD/main/xsrc/xc/programs/xconsole/xconsole.man,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 xconsole.man
*** xc/programs/xconsole/xconsole.man	30 Jun 1997 13:54:16 -0000	1.1.1.2
--- xc/programs/xconsole/xconsole.man	12 Aug 2003 21:21:39 -0000
***************
*** 41,51 ****
  .TP 8
  .B \-file \fIfile-name\fP
  To monitor some other device, use this option to specify the device name.
! This does not work on regular files as they are always ready to be read from.
  .TP 8
  .B \-notify \-nonotify
  When new data are received from the console and the notify option is set,
! the icon name of the application has " *" appended, so that it is evident
  even when the application is iconified.  \-notify is the default.
  .TP 8
  .B \-daemon
--- 41,53 ----
  .TP 8
  .B \-file \fIfile-name\fP
  To monitor some other device, use this option to specify the device name.
! If the file is a regular file then a read of zero bytes will put
! .I xconsole
! to sleep for one second.
  .TP 8
  .B \-notify \-nonotify
  When new data are received from the console and the notify option is set,
! the icon name of the application has "*** " prepended, so that it is evident
  even when the application is iconified.  \-notify is the default.
  .TP 8
  .B \-daemon
Index: xc/programs/xconsole/xconsole.c
===================================================================
RCS file: /cvs/master/m-NetBSD/main/xsrc/xc/programs/xconsole/xconsole.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 xconsole.c
*** xc/programs/xconsole/xconsole.c	1 Sep 1999 18:52:43 -0000	1.1.1.4
--- xc/programs/xconsole/xconsole.c	12 Aug 2003 21:19:36 -0000
***************
*** 376,385 ****
  	return;
      XtSetArg (arglist[0], XtNiconName, &oldName);
      XtGetValues (top, arglist, 1);
!     newName = malloc (strlen (oldName) + 3);
      if (!newName)
  	return;
!     sprintf (newName, "%s *", oldName);
      XtSetArg (arglist[0], XtNiconName, newName);
      XtSetValues (top, arglist, 1);
      free (newName);
--- 376,385 ----
  	return;
      XtSetArg (arglist[0], XtNiconName, &oldName);
      XtGetValues (top, arglist, 1);
!     newName = malloc (strlen (oldName) + 5);
      if (!newName)
  	return;
!     sprintf (newName, "*** %s", oldName);
      XtSetArg (arglist[0], XtNiconName, newName);
      XtSetValues (top, arglist, 1);
      free (newName);
***************
*** 405,416 ****
      XtSetArg (arglist[0], XtNiconName, &oldName);
      XtGetValues (top, arglist, 1);
      oldlen = strlen (oldName);
!     if (oldlen >= 2) {
!     	newName = malloc (oldlen - 1);
      	if (!newName)
  	    return;
!     	strncpy (newName, oldName, oldlen - 2);
! 	newName[oldlen - 2] = '\0';
      	XtSetArg (arglist[0], XtNiconName, newName);
      	XtSetValues (top, arglist, 1);
      	free (newName);
--- 405,415 ----
      XtSetArg (arglist[0], XtNiconName, &oldName);
      XtGetValues (top, arglist, 1);
      oldlen = strlen (oldName);
!     if (oldlen >= 5) {
!     	newName = malloc (oldlen - 5);
      	if (!newName)
  	    return;
!     	strcpy (newName, oldName + 4);
      	XtSetArg (arglist[0], XtNiconName, newName);
      	XtSetValues (top, arglist, 1);
      	free (newName);
>Release-Note:
>Audit-Trail:
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.