Bug 305162 - Konsole notification "Bell in session" should have button to bring up that session
Summary: Konsole notification "Bell in session" should have button to bring up that se...
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.9
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-14 19:58 UTC by Darin McBride
Modified: 2022-07-05 16:41 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Makes a button on the notification window open the responsible session (6.09 KB, patch)
2012-12-11 22:51 UTC, Kasper Laudrup
Details
Updated patch (6.14 KB, patch)
2016-07-02 21:26 UTC, Martin Sandsmark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Darin McBride 2012-08-14 19:58:11 UTC
The summary pretty much is it: when I get a "Bell in session 'Shell'" and I have 30+ tabs over 10 konsoles open, I don't know which one just gave me the bell.  Some way to bring the particular tab from the particular konsole session on the particular desktop (and/or activity) to the foreground would be really really useful.
Comment 1 Jekyll Wu 2012-08-15 03:03:03 UTC
Thanks for reporting. I agree that is really nice idea and improvement, although I need to get more knowledge about the KDE notification system to judge whether it is possible to do that.
Comment 2 Darin McBride 2012-08-15 04:48:29 UTC
From the notification side, choqok (KDE-based, but not part of the "official" core KDE SC) does something like this, at least from the notification side.  It has a button in the notification that I can click on, and that brings choqok up to nearly (!?) the front, showing it if it was minimised, switching desktops (I think), etc.  Maybe if you looked at choqok's code for notifications it might inspire you?

Thanks a lot for the response.
Comment 3 Kasper Laudrup 2012-12-11 22:51:15 UTC
Created attachment 75789 [details]
Makes a button on the notification window open the responsible session

Hi,

The patch here creates a button which opens the session which caused the bell when a notification is sent.

It involves a bit (maybe too much?) of signal slot connections, since the main window should be shown ,but the underlying session giving the bell naturally doesn't know about the application it's located in etc.

Hope this is useful
Comment 4 Jekyll Wu 2012-12-21 04:52:26 UTC
(In reply to comment #3)
> Created attachment 75789 [details]
> Makes a button on the notification window open the responsible session
> 
> Hi,
> 
> The patch here creates a button which opens the session which caused the
> bell when a notification is sent.
> 
> It involves a bit (maybe too much?) of signal slot connections, since the
> main window should be shown ,but the underlying session giving the bell
> naturally doesn't know about the application it's located in etc.
> 
> Hope this is useful

Thanks for the patch. It really helps. I will try to make the feature and patch into KDE SC 4.11
Comment 5 Kasper Laudrup 2013-01-03 13:17:20 UTC
(In reply to comment #4)
> 
> Thanks for the patch. It really helps. I will try to make the feature and
> patch into KDE SC 4.11

I'm happy to hear that I can be helpful. I enjoy making these minor improvement patches and since the response from you Konsole maintainers has been so positive, I'll hopefully continue to do so.

Btw. my patch introduces a warning I forgot to fix about an unused variable in the notificationClicked() function in TerminalDisplay.cpp. Simply removing the name of the variable or using the Q_UNUSED macro gets rid of that warning.

I can resubmit the patch with that change if you wish?
Comment 6 Martin Sandsmark 2016-07-02 21:26:15 UTC
Created attachment 99815 [details]
Updated patch

I updated the patch to build with the latest konsole master branch.

I don't need this myself, so if someone else wants to feel free to continue on it on reviewboard.kde.org.
Comment 7 mathew 2018-05-17 17:46:44 UTC
So, what happened to this patch? Did it get forgotten?

I'm getting notifications saying "Bell in session 'Default'", which is pretty useless since all my tabs are using the default terminal configuration, and there's no way to find out which one is belling and no button.
Comment 8 Kurt Hindenburg 2018-05-18 03:44:27 UTC
Yes, I don't recall this report at all - I'll try to look at it sometime.
Comment 9 fire f. 2019-12-17 17:28:03 UTC
does systemd journal learn of BELL events ?
Comment 10 Ricardo J. Barberis 2021-03-17 18:48:03 UTC
A few months ago I noticed that if I click on a Slack notification it not only focuses the rigth tab in my browser (Opera), it also takes me to the channel where the notificacion originated.

So, theoretically this should be possible to implement in Konsole and other apps.

In fact, I thought this may actually be working right now.

But how to test it? Is there a simple way to reproduce a bell in Konsole?
Comment 11 Bug Janitor Service 2022-01-13 12:13:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/581
Comment 12 tcanabrava 2022-07-05 09:08:55 UTC
Git commit 8fb68993891996dfcb1dee0d3ddc97870b19d430 by Tomaz  Canabrava, on behalf of Luis Javier Merino Morán.
Committed on 05/07/2022 at 09:04.
Pushed by tcanabrava into branch 'master'.

Focus session from notification

Adds a "Show session" button to notifications, which, when clicked, will
focus the originating session.

Original patch by Kasper Laudrup at bug 305162, then updated by Martin
T. H. Sandsmark.

Now updated and extended to silence/activity/process termination
notifications, adding support for focusing a TerminalDisplay inside a
hierarchy of ViewSplitters inside a TabbedViewContainer, and using
KWindowSystem::forceActiveWindow() instead of ::activateWindow().
Related: bug 344208

M  +6    -0    src/MainWindow.cpp
M  +3    -0    src/MainWindow.h
M  +1    -0    src/ViewManager.cpp
M  +2    -0    src/ViewManager.h
M  +14   -10   src/session/Session.cpp
M  +8    -5    src/session/SessionController.cpp
M  +9    -4    src/terminalDisplay/TerminalBell.cpp
M  +3    -1    src/terminalDisplay/TerminalBell.h
M  +5    -0    src/terminalDisplay/TerminalDisplay.cpp
M  +3    -0    src/terminalDisplay/TerminalDisplay.h
M  +14   -0    src/widgets/ViewContainer.cpp
M  +1    -0    src/widgets/ViewContainer.h

https://invent.kde.org/utilities/konsole/commit/8fb68993891996dfcb1dee0d3ddc97870b19d430
Comment 13 Ricardo J. Barberis 2022-07-05 16:41:03 UTC
This is really cool!

Does anybody know if this will work for yakuake also, or only konsole?
X11, Wayland or both?

Thanks!