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.
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.
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.
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.
(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
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?
(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
(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
(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.
(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.
[...] > = 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.
(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 ;)
(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.
(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.
(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.
(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?
(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.
(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?
Functionality implemented.
(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
(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
(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.
(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
(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?
(In reply to poma from comment #22) I've submitted an issue for Cinnamon: https://github.com/linuxmint/Cinnamon/issues/5523
(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!
(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
*** Bug 5514 has been marked as a duplicate of this bug. ***
(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.