Subject: Bug#3827: Tk4.0's bell flashes the display

From: Philippe Troin <[email-masked]>
Date: Thu, 18 Jul 1996 00:52:58 -0700 (PDT)

Package: tk40
Version: 4.0p3-3

I found a problem with wish/tk4.0. When one uses the wish `bell' command,
the display flashes badly (probably changing quickly to the underlaying
console text mode, and then back to the graphic mode).

This simple script will demonstrate the problem:
	#!/usr/bin/wish
	bell
	exit 0

After investigation, it appeared that that the bell command sends a
XForceScreenSaver request to the server, which is what causes the flash.

This quick'n'dirty patch will fix the problem:

diff -cr tk4.0.orig/tkCmds.c tk4.0/tkCmds.c
*** tk4.0.orig/tkCmds.c	Sat Jun 24 17:43:37 1995
--- tk4.0/tkCmds.c	Wed Jul 17 23:56:48 1996
***************
*** 77,83 ****
  	}
      }
      XBell(Tk_Display(tkwin), 0);
!     XForceScreenSaver(Tk_Display(tkwin), ScreenSaverReset);
      XFlush(Tk_Display(tkwin));
      return TCL_OK;
  }
--- 77,83 ----
  	}
      }
      XBell(Tk_Display(tkwin), 0);
!     /*    XForceScreenSaver(Tk_Display(tkwin), ScreenSaverReset); */
      XFlush(Tk_Display(tkwin));
      return TCL_OK;
  }

I guess that the idea behind this XForceScreenSaver is to reset the screensaver
if a wish application sends a beep.

However, the other beeping programs didn't show the problem, and think Tk
justs wants to be better than the others :-)

I think the definitive patch would be to fix the XF86 server so that it
doesn't blink when the XForceScreenSaver X request is received.

Phil.

Some configuration information:
Debian 1.1 (mostly, except some packages fixes)
Linux tantale 2.0.7 #1 Mon Jul 15 21:40:10 PDT 1996 i486
libc 5.2.18

Package: tk40
Status: install ok installed
Priority: optional
Section: devel
Maintainer: David Engel <[email-masked]>
Source: tk40
Version: 4.0p3-3
Depends: tcl74 (>= 7.4p3-3), elf-x11r6lib
Conflicts: tk
Description: The Tk toolkit for TCL and X11 v4.0 - Run-Time Package.
 Tk is an X11 toolkit that provides the Motif look and feel and is 
 implemented using the Tcl scripting language.

Package: tcl74
Status: install ok installed
Priority: optional
Section: devel
Maintainer: David Engel <[email-masked]>
Source: tcl74
Version: 7.4p3-3
Depends: libc5 (>= 5.2.18-5)
Conflicts: tcl
Description: The Tool Command Language (TCL) v7.4 - Run-Time Package.
 TCL is a powerful, easy to use, interpreted scripting language.

Package: xlib
Status: install ok installed
Priority: standard
Section: x11
Maintainer: Stephen Early <[email-masked]>
Source: XFree86
Version: 3.1.2-7
Replaces: elf-x11r6lib
Provides: xR6shlib, xlibraries, elf-x11r6lib
Depends: libc5, ldso (>= 1.7.14-1)
Conflicts: elf-x11r6lib
Description: XFree86 3.1.2 shared libraries

Package: xserver-svga
Status: install ok installed
Priority: optional
Section: x11
Maintainer: Stephen Early <[email-masked]>
Source: XFree86
Version: 3.1.2-5
Replaces: xsvga
Provides: xserver
Depends: libc5
Recommends: xfntbase
Suggests: xbase
Conflicts: xsvga
Description: XFree86 3.1.2 SVGA server
 This package provides an X server suitable for use with all SVGA video
 cards. The server also makes use of the accelerator features of Cirrus,
 Western Digital and Oak chipsets.