After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 329108 - Please support setting X's URGENCY hint upon terminal beep
Please support setting X's URGENCY hint upon terminal beep
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.11.x
Other Linux
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
: 167783 420708 553778 558527 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-01-29 18:01 UTC by Loïc Minier
Modified: 2008-12-24 17:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add support for X' URGENCY hint upon terminal bell (459.05 KB, patch)
2006-01-29 18:02 UTC, Loïc Minier
needs-work Details | Review
Set the urgent hint on terminal bell. (4.30 KB, patch)
2007-01-17 16:21 UTC, Chris Wilson
rejected Details | Review
Simply emit a beep signal on terminal beep. (1.96 KB, patch)
2007-01-18 12:59 UTC, Chris Wilson
needs-work Details | Review
Emit a beep (1.71 KB, patch)
2007-01-18 20:15 UTC, Chris Wilson
none Details | Review
updated version of the patch (2.24 KB, patch)
2008-06-24 08:26 UTC, Mikel Ward
none Details | Review
updated version of the patch (1.76 KB, patch)
2008-06-24 08:28 UTC, Mikel Ward
committed Details | Review
how I did it on XFCE Terminal (2.15 KB, patch)
2008-08-08 07:49 UTC, Mikel Ward
none Details | Review
how I did it on XFCE Terminal - corrected version (2.31 KB, patch)
2008-08-08 14:55 UTC, Mikel Ward
none Details | Review

Description Loïc Minier 2006-01-29 18:01:25 UTC
Hi,

Jeroen van Wolffelaar provided in Debian bug http://bugs.debian.org/276575 a preliminary patch to support X' URGENCY hint in vte.  Quoting Jeroen:
"When one has opened a lot of terminals, it can be tricky to find the one
terminal that made your system beep, or maybe you were away while that
happened. Therefore, it'd be nice if gnome-terminal could set the
urgency hint on the X window, so that the window manager in use can
alert the user. This is particularly interesting using ion2
windowmanager, but others also support this hint.

This patch will enable this feature, it works to my satisfaction, but it
has the following caveats:

- it doesn't clear the urgency hint, I don't know how it gets cleared
  (window manager? gnome-terminal itself upon focus?), but anyway, it
  gets somehow cleared when it has focus (and seems to not get set if
  having focus)
- it is always-enabled. The code is easily moved to be enabled with
  either the visible-bell or audible-bell options
- It will segfault if widget->window doesn't exist, or has no TopLevel
  GdkWindow, or that TopLevel GdkWindow doesn't have hints (TTBOMK, this
  should never-happen[tm])

Of course, feel free to drop the BEGIN/END added comments, I used that
for my own convenience locally managing this unofficial patch. I submit
this code under whatever licence this library is under, as long as it
remains Debian Free Software Guidelines-Free."

I tested the patch, and it will make the icon of a gnome-terminal window blink in the task list as soon as a terminal bell rings, however metacity doesn't reset the hint as Jeroen experienced (presumably he runs a different WM).

I'll attach his patch updated to apply to 0.11.17.

Cheers,
Comment 1 Loïc Minier 2006-01-29 18:02:23 UTC
Created attachment 58337 [details] [review]
Add support for X' URGENCY hint upon terminal bell
Comment 2 Guilherme de Siqueira Pastore 2006-01-29 23:15:04 UTC
Of course this needs work if the thing never stops blinking under our official window manager.
Comment 3 Guilherme de Siqueira Pastore 2006-01-29 23:15:44 UTC
Oh, also setting to NEW, this is a nice thing to have.
Comment 4 Behdad Esfahbod 2006-04-12 09:28:29 UTC
Guilherme, you think it should stop blinking after a while?
Comment 5 Loïc Minier 2006-08-15 19:11:16 UTC
(Setting to NEW again as I think NEEDINFO is more when people are waiting for the submitter.)
Comment 6 Chris Wilson 2007-01-17 16:21:55 UTC
Created attachment 80520 [details] [review]
Set the urgent hint on terminal bell.

Uses the Gtk+ interface rather than raw X WM hints, and remembers to disable it after a second.
Comment 7 Behdad Esfahbod 2007-01-17 21:30:15 UTC
After a second?

I think it should stop after 1) you switch to its window, or 2) you type something.

The entire idea is to retain the fact that it beeped.  If it stops after one second, it's just a fancier beep.
Comment 8 Mariano Suárez-Alvarez 2007-01-17 22:03:11 UTC
Shouldn't the widget emit a "beep" signal, so that apps interested in the urgency hint can set it themselves? 

This patch is not notifying the app, and an app may have several vte widgets (gnome-terminal...) and may want to do something smarter than simply get its toplevel flashed (someday, GNOME may decide on a standard way to do activity signaling in tabbed interfaces and elsewhere). Or it may have several things in its UI that can be in need of urgent attention and then it may be of use to know exactly -which- widget is feeling the urge to get attention... &c.

I'm not a great fan of widgets that do things on their toplevel, I guess.

Comment 9 Behdad Esfahbod 2007-01-17 22:06:37 UTC
True.  g-t should highlight the tab for example.
Comment 10 Chris Wilson 2007-01-18 12:59:38 UTC
Created attachment 80590 [details] [review]
Simply emit a beep signal on terminal beep.
Comment 11 Mariano Suárez-Alvarez 2007-01-18 19:07:06 UTC
Thanks. From looking at the patch:

* The signal is created with the name "bell" but your call to 
g_signal_emit_by_name uses "beep".
* The patch has an extraneous bell_signal member added to VteTerminalClass.
* Avoid adding whitespace lines ;-) The source looks funny as it is ;-)

I have not tested the patch (from the 1st bullet above it cannot work, really) but looks essentially correct.
Comment 12 Chris Wilson 2007-01-18 20:15:22 UTC
Created attachment 80642 [details] [review]
Emit a beep

The signal name should be a verb so beep is preferred over bell.
Comment 13 Chris Wilson 2007-03-20 20:57:03 UTC
*** Bug 420708 has been marked as a duplicate of this bug. ***
Comment 14 Sebastian Dröge (slomo) 2008-03-11 06:45:22 UTC
The patch looks good and ready to commit IMHO, would only be nice to have it's counterpart patch for gnome-terminal :)
Comment 15 Behdad Esfahbod 2008-03-11 06:57:25 UTC
Need to branch&bump, but looks good to go.
Comment 16 Mikel Ward 2008-06-24 08:26:04 UTC
Created attachment 113316 [details] [review]
updated version of the patch

The current patch doesn't apply to trunk.  This version should.
Comment 17 Mikel Ward 2008-06-24 08:28:40 UTC
Created attachment 113317 [details] [review]
updated version of the patch

Sorry, that used g_signal_emit which didn't work.  This one uses g_signal_emit_by_name as the original patch did.
Comment 18 Mikel Ward 2008-08-08 07:49:54 UTC
Created attachment 116122 [details] [review]
how I did it on XFCE Terminal

This is what was required for XFCE's Terminal.

The signals and the general method should be the same for GNOME Terminal.
Comment 19 Christian Persch 2008-08-08 10:30:58 UTC
That patch is broken: the focus-in-event handler needs to return a gboolean, not void.

For g-t, I'd probably just use whether the beeping tab is the active tab or not.
Comment 20 Mikel Ward 2008-08-08 14:55:10 UTC
Created attachment 116152 [details] [review]
how I did it on XFCE Terminal - corrected version

Thanks Christian.  That explains why I had to explicitly refresh the VTE widget.  Explicitly returning FALSE should cause the event to bubble thru to VTE as well.
Comment 21 Christian Persch 2008-09-25 14:36:24 UTC
*** Bug 167783 has been marked as a duplicate of this bug. ***
Comment 22 Christian Persch 2008-09-25 14:37:27 UTC
*** Bug 553778 has been marked as a duplicate of this bug. ***
Comment 23 Christian Persch 2008-10-06 20:11:18 UTC
Fixed on trunk.
Comment 24 Christian Persch 2008-10-30 13:33:28 UTC
IMHO we should rename the signal from "beep" to "bell".
Comment 25 Christian Persch 2008-10-30 13:53:31 UTC
*** Bug 558527 has been marked as a duplicate of this bug. ***
Comment 26 Mikel Ward 2008-10-30 19:55:26 UTC
I don't have a strong preference, other than that I've already got GNOME Terminal and XFCE Terminal working with it called "beep".

I kept the name "beep" in my respin of the patch based on Chris Wilson's comment in January 2007 (comment 13):
The signal name should be a verb so beep is preferred over bell.