tdesktop icon indicating copy to clipboard operation
tdesktop copied to clipboard

Telegram comes to focus when clicking notifications from other applications

Open EvgeniiFrolov opened this issue 11 years ago • 44 comments

I actually don't know if this is Telegram or KDE bug, but when Telegram is launched and minimized to tray and a new e-mail arrives triggering a "New mail notification" and you push "Show mail" button -> Telegram desktop app is maximized. The same is when you get a download finished in FireFox and receive a notification with a button "Open" (to open a folder with the downloaded file). Push the button and for some reason Telegram app is maximized. I use gentoo. Telegram app is simply downloaded from its web-site.

So, steps to reproduce (always for me):

  1. configure KDE notifications so that they have some buttons to push, e.g. "Show mail" for KMail.
  2. Start Telegram and minimize it to tray.
  3. Receive a button-containing-notification
  4. Push a button in it.

Expected result: Show a KMail with new message. Actual result: Telegram is maximized and focused. The new message is opened in a background. Reproduces always.

I attach a screenshot with an example of the notifications and buttons.

telegram-send

EvgeniiFrolov avatar Aug 21 '15 16:08 EvgeniiFrolov

Actually even when Telegram is not minimezed, on the button-press it is focused in the first place and only after it that the intended button-action takes place.

EvgeniiFrolov avatar Aug 25 '15 07:08 EvgeniiFrolov

You may want to take a look here too: https://bugs.gentoo.org/show_bug.cgi?id=537266

ghost avatar Apr 23 '16 20:04 ghost

I get the same effect using Firefox with Gnotifier when clicking the action button on the notification, on Plasma Desktop 5.7.3 and telegram-desktop-bin from the AUR on Arch Linux.

Well, not maximized, but raised.

AndydeCleyre avatar Sep 01 '16 18:09 AndydeCleyre

Hi, I have the same issue, but I'm using Debian 8.8 and KDE 4.14.2.

zargex avatar May 08 '17 19:05 zargex

Pull request with a fix would help a lot :)

auchri avatar Aug 10 '17 13:08 auchri

So it happens on KDE4&5 and GNOME3?

stek29 avatar Aug 10 '17 13:08 stek29

It happened to me on Plasma5 too (SUSE Tumbleweed April-May, 2017).

EvgeniiFrolov avatar Aug 22 '17 14:08 EvgeniiFrolov

Same on KDE Plasma 5.10.5

z3ntu avatar Oct 04 '17 10:10 z3ntu

Can't reproduce with latest Telegram, KDE Plasma 5.5.5, Qt 5.5.1, Linux Mint 18.2, Kernel 4.10.0-35-generic.

I've tried KMail 5.1.3, but its notifications don't have any buttons =( image

Tried Skype 5.5.0.1 - View button opens Skype not Telegram. screenshot_20171005_000111

There must be something else in this case.

roma-guru avatar Oct 04 '17 21:10 roma-guru

@roman-voropaev I can reproduce with eg browser notifications from both Firefox and Chrome. Can you try https://jsbin.com/ziwod/2/edit?html,js,output ?

z3ntu avatar Oct 04 '17 21:10 z3ntu

@z3ntu web notification returns focus to Firefox image

Here Telegram notification opens Telegram image

roma-guru avatar Oct 04 '17 21:10 roma-guru

Started getting the same issue recently, Telegram 1.1.23 alpha, GNOME Shell version 3.24

null-von-sushi avatar Oct 08 '17 05:10 null-von-sushi

Okay, not sure why this is happening, but I found that it stopped after I disabled the KStatusNotifierItem extension for gnome. It seems that this issue only occurs when Telegram is using an AppIndicator / KStatusNotifier tray icon, not the old style tray icon.

null-von-sushi avatar Oct 09 '17 05:10 null-von-sushi

I'm getting this in Ubuntu with Gnome shell 3.26.1 and "Topicons - legacy tray icons" extension. Any notification from Firefox or any other application focuses Telegram when it's clicked. This is independent of whether Telegram is open, closed, maximized or minimized.

daboross avatar Nov 07 '17 19:11 daboross

As referenced above, this happens for both Telegram and Mega programs.

domsle avatar Nov 15 '17 15:11 domsle

@jhasse Do you maybe know why this happens?

auchri avatar Nov 15 '17 16:11 auchri

Sorry, no idea whatsoever :(

jhasse avatar Nov 15 '17 18:11 jhasse

I'm also seeing this bug but when I'm actively testing for it, it's inconsistent. Sometimes Telegram opens up, sometimes it doesn't, sometimes I just get an extra notification "Telegram is ready" after clicking the original notification without telegram popping up.

It's actually mostly the latter two in a run of 20 notifications tests.

Emerentius avatar Dec 07 '17 15:12 Emerentius

I can reproduce the issue 100% of the time with Firefox and the example at https://developer.mozilla.org/en-US/docs/Web/API/notification#Example (scroll down a bit to the "Notify me!" button)

z3ntu avatar Dec 07 '17 16:12 z3ntu

Well at least I found a regularity For me telegram pops into focus when it's hidden in the tray. If it's open in the task bar, I get the second notification "Telegram is ready" but it stays in the background. Doesn't matter if Telegram is minimized or not. After that first ready-notification, no more appear on subsequent notifications unless telegram is brought into focus again.

For completeness sake, this is on ubuntu 17.10 with gnome 3.26 under both wayland and x11.

It's also NOT happening with thunderbird notifications.

Emerentius avatar Dec 07 '17 16:12 Emerentius