! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfce4-terminal does not support urgent-bells. patch included.
Status:
RESOLVED: FIXED
Product:
Xfce4-terminal
Component:
General

Comments

Description iamtakingiteasy 2013-03-17 18:47:33 CET
Created attachment 4969 
Adds a basic urgent-bell support

Unlike rxvt and xterm, xfce4-terminal has no option to enable urgent bells, which are quite useful with such applications as irssi, mutt and other TUI-messangers, which utilize "bell on highlight" concept - sending a bell sequence (\007\c) to a terminal, notifying that user got a message from someone.

This patch adds a basic support for this concept, and makes it optional via `terminalrc` configuration file.

When option named "MiscBellUrgent" set to "TRUE" - it provides an urgent hint for top-level GTK window and unmarks this hint on user interaction with terminal, such as focusing on terminal window or pressing a key.

(just the same it works with rxvt and xterm xrdb properties)

This patch might be awful in code style and utilized concepts, so don't hesitate to blame me for bad coding - just let me know what needs to be fixed in order to push this patch to upstream.

You may test this patch by enabling MiscBellUrgent in config and executing something like `sleep 1 && echo -e "\007\c"` in terminal window, while having focus on other window or even other wm tag.

Thanks.
Comment 1 iamtakingiteasy 2013-03-18 10:10:00 CET
Created attachment 4971 
Updated patch, with disabling urgent on scroll event as well as on keypress

Updated patch, now it is with disabling urgent on scroll event as well as on keypress.
Comment 2 Igor editbugs 2016-08-01 12:16:47 CEST
Unfortunately, the patch introduces some issues on my machine:
- screen contents cannot be scrolled if mouse pointer does not point directly to the scrollbar;
- the bell sounds even if terminal window is active (though the intention was to disable it, as I understand).
I will have to improve this patch before it can be merged.
Comment 3 Igor editbugs 2016-08-01 14:13:06 CEST
Okay, I've fixed the scrolling issue but I'm lost in regards to what is the desired outcome of this change.

The terminal beeps on executing `echo -e "\a"` - but it's controlled by the MiscBell option.
With the new MiscBellUrgent option enabled, shall the terminal beep after running e.g. `sleep 5` if the window has no focus? I'm not hearing any beeps.
Comment 4 poma 2016-08-02 11:45:43 CEST
(In reply to Igor from comment #3)
> Okay, I've fixed the scrolling issue but I'm lost in regards to what is the
> desired outcome of this change.
> 

Possibly relating to the following functionality:

Set audible bell
https://help.gnome.org/users/gnome-terminal/3.20/pref-bell.html.en
https://help.gnome.org/users/gnome-terminal/stable/pref-bell.html.en

Choose or disable the alert sound
https://help.gnome.org/users/gnome-help/3.20/sound-alert.html.en
https://help.gnome.org/users/gnome-help/stable/sound-alert.html.en

Works with gnome-terminal within gnome-shell.


Perhaps referring also to a broader context,
"Customize the "sound" of your desktop" - Event Sounds
http://docs.xfce.org/xfce/xfce4-settings/appearance#event_sounds
http://0pointer.de/lennart/projects/libcanberra
http://goo.gl/Gm4ffO
pics/mailers - pavucontrol & xfce4-appearance-settings


> The terminal beeps on executing `echo -e "\a"` - but it's controlled by the
> MiscBell option.
> With the new MiscBellUrgent option enabled, shall the terminal beep after
> running e.g. `sleep 5` if the window has no focus? I'm not hearing any beeps.

$ sleep 5 ; echo -e '\a'
works i.e. "sounds" - even if window unfocused
Comment 5 Igor editbugs 2016-08-02 16:44:26 CEST
I've reworked the patch and pushed it as https://git.xfce.org/apps/xfce4-terminal/commit/?id=43b8d559a2f8be119b9c6afd4daccf0405e346a3

The patch considers the MiscBellUrgent option only if MiscBell is set to TRUE (which means you have to set both of them to TRUE to get urgent bell functionality). Do you think this is valid behavior, or should these 2 be separated?
Comment 6 poma 2016-08-03 06:17:57 CEST
(In reply to Igor from comment #5)
> I've reworked the patch and pushed it as
> https://git.xfce.org/apps/xfce4-terminal/commit/
> ?id=43b8d559a2f8be119b9c6afd4daccf0405e346a3
> 
> The patch considers the MiscBellUrgent option only if MiscBell is set to
> TRUE (which means you have to set both of them to TRUE to get urgent bell
> functionality). Do you think this is valid behavior, or should these 2 be
> separated?

The common denominator for both is MiscBell, therefore I guess they should go sottobraccio.

BTW, should the urgency hint show a window or just a window button, as it is now?

e.g. "Reproducer program" shows a window, on all Workspaces
http://bug-attachment.xfce.org/attachment.cgi?id=3385
Ref.
https://bugzilla.xfce.org/show_bug.cgi?id=6150
Comment 7 poma 2016-08-03 08:08:41 CEST
(In reply to Igor from comment #5)
[...]
> The patch considers the MiscBellUrgent option only if MiscBell is set to
> TRUE (which means you have to set both of them to TRUE to get urgent bell
> functionality). Do you think this is valid behavior, or should these 2 be
> separated?


How Notification actually works within Xfce session

= Sound Notification =
- HW bell:
# modprobe pcspkr
internal PC speaker *beep*
OR
- SW bell :
According to Poettering, event sound on the server side via PulseAudio is the wrong approach
https://bugzilla.redhat.com/show_bug.cgi?id=607393#c22
/etc/pulse/default.pa
load-sample-lazy x11-bell /usr/share/sounds/freedesktop/stereo/bell.oga
load-module module-x11-bell sample=x11-bell
$ xset b 100

= Visual Notification =
- If Terminal window is Minimized, shows Window Button on all Workspaces
The optimum would be an additional option to show (Unminimized) Terminal window

With:
$ sleep 5 ; echo -e '\a'

~/.config/xfce4/terminal/terminalrc
[Configuration]
...

- No Soud Notification / No Visual Notification
MiscBell=FALSE
MiscBellUrgent=FALSE

- Sound Notification Only
MiscBell=TRUE
MiscBellUrgent=FALSE

- Visual Notification Only
MiscBell=FALSE
MiscBellUrgent=TRUE

- Sound Notification and Visual Notification
MiscBell=TRUE
MiscBellUrgent=TRUE
Comment 8 Igor editbugs 2016-08-03 10:44:31 CEST
(In reply to poma from comment #6)
> BTW, should the urgency hint show a window or just a window button, as it is
> now?
> 
> e.g. "Reproducer program" shows a window, on all Workspaces
> http://bug-attachment.xfce.org/attachment.cgi?id=3385
> Ref.
> https://bugzilla.xfce.org/show_bug.cgi?id=6150
By "show a window" do you mean changing focus to that window? If so, I think I do not support this idea.
Comment 9 Igor editbugs 2016-08-03 10:46:13 CEST
(In reply to poma from comment #7)
> - Visual Notification Only
> MiscBell=FALSE
> MiscBellUrgent=TRUE
Yes, I was mistaken saying that both options had to be set to TRUE. However, the MiscBellUrgent option change wasn't handled - this is fixed by the last commit.
Comment 10 poma 2016-08-03 14:32:57 CEST
[...]
> = Visual Notification =
> - If Terminal window is Minimized, shows Window Button on all Workspaces

Pardon me,
If Terminal window is *Unfocused*, shows Window Button on all Workspaces
should be correct case.
Comment 11 poma 2016-08-03 14:35:59 CEST
(In reply to Igor from comment #9)
> (In reply to poma from comment #7)
> > - Visual Notification Only
> > MiscBell=FALSE
> > MiscBellUrgent=TRUE
> Yes, I was mistaken saying that both options had to be set to TRUE. However,
> the MiscBellUrgent option change wasn't handled - this is fixed by the last
> commit.

Both, MiscBell and MiscBellUrgent, still (inter)act as before ;)
Comment 12 Igor editbugs 2016-08-03 14:38:03 CEST
(In reply to poma from comment #10)
> Pardon me,
> If Terminal window is *Unfocused*, shows Window Button on all Workspaces
> should be correct case.
I think this is the window manager's responsibility.
My Cinnamon installation is showing blinking window button on other workspaces.
Comment 13 poma 2016-08-03 14:51:27 CEST
(In reply to Igor from comment #8)
> (In reply to poma from comment #6)
> > BTW, should the urgency hint show a window or just a window button, as it is
> > now?
> > 
> > e.g. "Reproducer program" shows a window, on all Workspaces
> > http://bug-attachment.xfce.org/attachment.cgi?id=3385
> > Ref.
> > https://bugzilla.xfce.org/show_bug.cgi?id=6150
> By "show a window" do you mean changing focus to that window? If so, I think
> I do not support this idea.

Considering neither the gnome-terminal is working like that, but rather is using NotifyOSD mechanism
$ dconf read /org/gnome/desktop/notifications/application/org-gnome-terminal/show-banners 
true

This even works within Xfce session,
a pop up notification bubble via Xfce Notification Daemon, with a message, and a button to click on to gain focus on Terminal window.
Comment 14 poma 2016-08-03 15:16:35 CEST
(In reply to Igor from comment #12)
> (In reply to poma from comment #10)
> > Pardon me,
> > If Terminal window is *Unfocused*, shows Window Button on all Workspaces
> > should be correct case.
> I think this is the window manager's responsibility.
> My Cinnamon installation is showing blinking window button on other
> workspaces.

"Notify of urgency by making window's decoration blink"
http://docs.xfce.org/xfce/xfwm4/wmtweaks#accessibility
is broken,
however even if it works it is already obsolete notify method.

Modern NotifyOSD mechanism is a way to go.
Comment 15 Igor editbugs 2016-08-03 15:58:52 CEST
(In reply to poma from comment #14)
> "Notify of urgency by making window's decoration blink"
> http://docs.xfce.org/xfce/xfwm4/wmtweaks#accessibility
> is broken,
> however even if it works it is already obsolete notify method.
Well, this is standard GTK mechanism which has not been declared deprecated. Even if some WMs ignore it, I don't think it's enough to drop it.

> Modern NotifyOSD mechanism is a way to go.
I think this could be a subject for another feature request. The work here seems to be done.

For now, I'm going to close this bug as resolved. Does anyone have any objections?
Comment 16 poma 2016-08-03 18:12:23 CEST
(In reply to Igor from comment #15)
> (In reply to poma from comment #14)
> > "Notify of urgency by making window's decoration blink"
> > http://docs.xfce.org/xfce/xfwm4/wmtweaks#accessibility
> > is broken,
> > however even if it works it is already obsolete notify method.
> Well, this is standard GTK mechanism which has not been declared deprecated.
> Even if some WMs ignore it, I don't think it's enough to drop it.
> 

Not within Xfce's window manager,
but Blinking Button is supposed to be resolved in xfce4-panel plugin "tasklist" aka "Window Buttons",
but in fact nothing Blinking.
So typical.

> > Modern NotifyOSD mechanism is a way to go.
> I think this could be a subject for another feature request. The work here
> seems to be done.
> 

Fair enough.

> For now, I'm going to close this bug as resolved. Does anyone have any
> objections?

Nevertheless, you did resolved it - old fashioned way.
Therfore, let's not wait for Godot.
Comment 17 Igor editbugs 2016-08-03 18:30:03 CEST
(In reply to poma from comment #16)
> Not within Xfce's window manager,
> but Blinking Button is supposed to be resolved in xfce4-panel plugin
> "tasklist" aka "Window Buttons",
> but in fact nothing Blinking.
> So typical.
tasklist should have its own bugzilla section. Is it maintained?
Comment 18 Igor editbugs 2016-08-03 18:30:25 CEST
Functionality implemented.
Comment 19 Igor editbugs 2016-08-03 18:33:50 CEST
(In reply to poma from comment #16)
Actually, there's a bug saying urgent blinking is annoying; so it's supposed to be working? https://bugzilla.xfce.org/show_bug.cgi?id=12668
Comment 20 poma 2016-08-03 21:37:07 CEST
(In reply to Igor from comment #19)
> (In reply to poma from comment #16)
> Actually, there's a bug saying urgent blinking is annoying; so it's supposed
> to be working? https://bugzilla.xfce.org/show_bug.cgi?id=12668

Thanks for reference, made me think (didn't know I'm capable of);

Window Button (the xfce4 pager) no longer blinks when windows are marked urgent
https://bugzilla.redhat.com/show_bug.cgi?id=906581#c16
Taskbar blinking does not work in Adwaita theme
https://bugzilla.novell.com/show_bug.cgi?id=809766
Comment 21 Igor editbugs 2016-08-04 11:20:11 CEST
(In reply to poma from comment #20)
> Thanks for reference, made me think (didn't know I'm capable of);
> 
> Window Button (the xfce4 pager) no longer blinks when windows are marked
> urgent
> https://bugzilla.redhat.com/show_bug.cgi?id=906581#c16
> Taskbar blinking does not work in Adwaita theme
> https://bugzilla.novell.com/show_bug.cgi?id=809766
Urgent blinking works for me on Cinnamon with Adwaita; xfce panel bug if there's one should be reported to its bugtracker.
Comment 22 poma 2016-08-04 16:51:35 CEST
(In reply to Igor from comment #21)
> (In reply to poma from comment #20)
> > Thanks for reference, made me think (didn't know I'm capable of);
> > 
> > Window Button (the xfce4 pager) no longer blinks when windows are marked
> > urgent
> > https://bugzilla.redhat.com/show_bug.cgi?id=906581#c16
> > Taskbar blinking does not work in Adwaita theme
> > https://bugzilla.novell.com/show_bug.cgi?id=809766
> Urgent blinking works for me on Cinnamon with Adwaita; xfce panel bug if
> there's one should be reported to its bugtracker.

Fedora Cinnamon Desktop Live
https://spins.fedoraproject.org/cinnamon/download/index.html

Cinnamon Desktop themes

$ find /usr/share/themes/ -name cinnamon
/usr/share/themes/BlackMATE/cinnamon
/usr/share/themes/Blue-Submarine/cinnamon
/usr/share/themes/Green-Submarine/cinnamon
/usr/share/themes/Menta/cinnamon
/usr/share/themes/BlueMenta/cinnamon

$ rpm -qf $(find /usr/share/themes/ -name cinnamon) | uniq
mate-themes-3.20.8-0.1.git20160526.59b3286.fc24.noarch

Tested with all the above mentioned, and 

Add/remove desktop themes...
$ find ~/.themes -name cinnamon
/home/liveuser/.themes/Adwaita CMM/cinnamon
/home/liveuser/.themes/Adwaita Classic/cinnamon

Adwaita-Cinnamon
~/.themes/Adwaita\ Classic[CMM]/cinnamon/cinnamon.css
really isn't original Adwaita
https://git.gnome.org/browse/gtk+/plain/gtk/theme/Adwaita/gtk-contained[-dark].css
so the comparison is questionable

however even with or without the Desktop themes impact,
also within the Cinnamon Desktop, there is inconsistency with regard to the "Urgent blinking"
Example when not working:
- within Xfce Terminal window run: sleep 5 ; echo -e '\a'
- thereupon left click on Desktop makes Terminal window unfocused
- but Window Button does not blink-ing-ing-ing-...

Panel:
$ rpm -qf /usr/share/cinnamon/js/ui/panel.js
cinnamon-3.0.4-1.fc24.x86_64

Window List:
$ rpm -qf /usr/share/cinnamon/applets/window-list@cinnamon.org/applet.js
cinnamon-3.0.4-1.fc24.x86_64
Comment 23 Igor editbugs 2016-08-04 17:09:38 CEST
(In reply to poma from comment #22)
> Adwaita-Cinnamon
> ~/.themes/Adwaita\ Classic[CMM]/cinnamon/cinnamon.css
> really isn't original Adwaita
> https://git.gnome.org/browse/gtk+/plain/gtk/theme/Adwaita/gtk-contained[-
> dark].css
> so the comparison is questionable
Could be - I haven't checked it.

> however even with or without the Desktop themes impact,
> also within the Cinnamon Desktop, there is inconsistency with regard to the
> "Urgent blinking"
> Example when not working:
> - within Xfce Terminal window run: sleep 5 ; echo -e '\a'
> - thereupon left click on Desktop makes Terminal window unfocused
> - but Window Button does not blink-ing-ing-ing-...
I can confirm that - the window button is not blinking is if it's not focused but _visible_. As soon as you switch to another window (even if the terminal is still visible), it begins blinking. So the only case when it's _not_ blinking is clicking on desktop.
Do you think it should be blinking even in that case?
Comment 24 Igor editbugs 2016-08-04 18:15:46 CEST
(In reply to poma from comment #22)
I've submitted an issue for Cinnamon: https://github.com/linuxmint/Cinnamon/issues/5523
Comment 25 poma 2016-08-04 23:39:55 CEST
(In reply to Igor from comment #24)
> (In reply to poma from comment #22)
> I've submitted an issue for Cinnamon:
> https://github.com/linuxmint/Cinnamon/issues/5523

Great!
Comment 26 poma 2016-08-04 23:40:57 CEST
(In reply to Igor from comment #23)
> (In reply to poma from comment #22)
> > Adwaita-Cinnamon
> > ~/.themes/Adwaita\ Classic[CMM]/cinnamon/cinnamon.css
> > really isn't original Adwaita
> > https://git.gnome.org/browse/gtk+/plain/gtk/theme/Adwaita/gtk-contained[-
> > dark].css
> > so the comparison is questionable
> Could be - I haven't checked it.
> 
> > however even with or without the Desktop themes impact,
> > also within the Cinnamon Desktop, there is inconsistency with regard to the
> > "Urgent blinking"
> > Example when not working:
> > - within Xfce Terminal window run: sleep 5 ; echo -e '\a'
> > - thereupon left click on Desktop makes Terminal window unfocused
> > - but Window Button does not blink-ing-ing-ing-...
> I can confirm that - the window button is not blinking is if it's not
> focused but _visible_. As soon as you switch to another window (even if the
> terminal is still visible), it begins blinking. So the only case when it's
> _not_ blinking is clicking on desktop.
> Do you think it should be blinking even in that case?

Of course,
considering Desktop itself is an applications, de facto clicking on it is as clicking on its window - it gains focus,
and for consistency's sake.


Urgent Hint Notification
https://github.com/shimmerproject/Blackbird/issues/17

Updated Darkgrey theme:
http://goo.gl/Gm4ffO
source/etc
Comment 27 Igor editbugs 2016-08-05 15:36:09 CEST
*** Bug 5514 has been marked as a duplicate of this bug. ***
Comment 28 poma 2016-08-07 19:02:51 CEST
(In reply to Igor from comment #8)
> (In reply to poma from comment #6)
> > BTW, should the urgency hint show a window or just a window button, as it is
> > now?
> > 
> > e.g. "Reproducer program" shows a window, on all Workspaces
> > http://bug-attachment.xfce.org/attachment.cgi?id=3385
> > Ref.
> > https://bugzilla.xfce.org/show_bug.cgi?id=6150
> By "show a window" do you mean changing focus to that window? If so, I think
> I do not support this idea.


Yeah, I knew it was in there somewhere,
Xterm has already achieved this "idea"!

In 'xterm', in addition to "bellIsUrgent"
- Specifies whether to set the Urgency hint for the window manager when making a bell sound,
equivalent to "MiscBellUrgent" in 'xfce4-terminal',
there is also an option "popOnBell"
- Specifies whether the window would be raised on when Control-G is received

~/.Xresources
! xrdb [-merge] .Xresources
! XTerm*bellIsUrgent: True
XTerm*popOnBell: True

Although it is specified in the manual - "If the window is iconified, this has no effect.",
iconified i.e. minimized - it actually works within Xfce session,
window is raised - it gains focus.

Bug #9928

Reported by:
iamtakingiteasy
Reported on: 2013-03-17
Last modified on: 2016-08-07
Duplicates (1):
  • 5514 Blink terminal (urgent) when command is finished

People

CC List:
4 users

Version

Attachments

Adds a basic urgent-bell support (3.03 KB, application/octet-stream)
2013-03-17 18:47 CET , iamtakingiteasy
no flags
Updated patch, with disabling urgent on scroll event as well as on keypress (3.58 KB, patch)
2013-03-18 10:10 CET , iamtakingiteasy
no flags

Additional information