[Konsole-devel] [Bug 90278] New: Bell can be over used

Andre Masella andre at masella.no-ip.org
Sun Sep 26 16:41:47 UTC 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
        
http://bugs.kde.org/show_bug.cgi?id=90278        
           Summary: Bell can be over used
           Product: konsole
           Version: unspecified
          Platform: Compiled Sources
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: general
        AssignedTo: konsole-devel kde org
        ReportedBy: andre masella no-ip org


Version:            (using KDE KDE 3.3.0)
Installed from:    Compiled From Sources

If you are in a Konsole window and do something which will ring the bell a lot (like holding down backspace in sh or cat'ing a binary file), Konsole will ring the bell for every single \a received. When using aRts, since it's non-blocking, the sounds begin to overlap and become really loud. aRts uses a fair chunk of CPU mixing them and will continue to ring after the problem is over.

In puTTY, there is an option where you can ignore the bell for a customisable number of seconds. It would be nice to have a similar feature to not ring the bell when it is being over-used.

I was able to get the bell to not ring, but I don't know how to add the configuration, so I hard coded the value at 2 second. I also don't know if it's okay to include sys/types.h and time.h.

Index: TEWidget.cpp
===================================================================
RCS file: /home/kde/kdebase/konsole/konsole/TEWidget.cpp,v
retrieving revision 1.216
diff -u -3 -p -r1.216 TEWidget.cpp
--- TEWidget.cpp        1 Jun 2004 12:31:20 -0000       1.216
+++ TEWidget.cpp        26 Sep 2004 16:38:50 -0000
 @ -410,6 +410,10  @ TEWidget::TEWidget(QWidget *parent, cons
     // Looks better at startup with KRootPixmap based pseudo-transparancy
     setBackgroundMode(NoBackground);
   }
+
+  // Bell over use
+  (void) time(&lastBell);
+
 }

 //FIXME: make proper destructor
 @ -1832,6 +1836,12  @ void TEWidget::setBellMode(int mode)

 void TEWidget::Bell(bool visibleSession, QString message)
 {
+  time_t currentTime;
+  (void) time(&currentTime);
+  if ((int) currentTime-lastBell < 2) { return; }
+
+  lastBell = currentTime;
+
   if (m_bellMode==BELLSYSTEM) {
     KNotifyClient::beep();
   } else if (m_bellMode==BELLNOTIFY) {
Index: TEWidget.h
===================================================================
RCS file: /home/kde/kdebase/konsole/konsole/TEWidget.h,v
retrieving revision 1.83
diff -u -3 -p -r1.83 TEWidget.h
--- TEWidget.h  9 Apr 2004 18:34:37 -0000       1.83
+++ TEWidget.h  26 Sep 2004 16:38:50 -0000
 @ -21,6 +21,9  @

 #include <kpopupmenu.h>

+#include <sys/types.h>
+#include <time.h>
+
 #include "TECommon.h"


 @ -282,6 +285,7  @ private:

     QPoint configureRequestPoint;  // remember right mouse button click position
     bool colorsSwapped; // true during visual bell
+    time_t lastBell; // time the bell was last rung

     // the rim should normally be 1, 0 only when running in full screen mode.
     int rimX;      // left/right rim width



More information about the konsole-devel mailing list