Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to interact with the tray icon and thus to quit the app (desktop version based on electron) (and weird icon issue) #3133

Closed
ArchangeGabriel opened this issue Feb 4, 2017 · 40 comments
Assignees
Labels
A-Electron P2 S-Major Severely degrades major functionality or product features, with no satisfactory workaround X-Cannot-Reproduce Z-Platform-Specific

Comments

@ArchangeGabriel
Copy link

When I start riot, I’ve got a strange behaviour. I either start it from within a terminal or using the desktop entry added by this .desktop file.

When starting a first time, it doesn’t work. A window is added to task manager if using the desktop entry, but then disappears without anything else happening; while using the terminal results in this:

Starting auto update with base URL: null
Auto update not supported on this platform
Unhandled exception TypeError: Error processing argument at index 0, conversion failure from /usr/lib/riot/electron/src/../img/riot.png
    at TypeError (native)
    at Object.exports.create (/usr/lib/riot/electron/src/tray.js:63:16)
    at App.electron.app.on (/usr/lib/riot/electron/src/electron-main.js:199:10)
    at emitTwo (events.js:111:20)
    at App.emit (events.js:191:7)

(electron:21415): Gdk-WARNING **: gdkwindow-x11.c:5573 drawable is not a native X11 window

(electron:21415): Gdk-WARNING **: gdkwindow-x11.c:5573 drawable is not a native X11 window

(electron:21415): Gdk-WARNING **: gdkwindow-x11.c:5573 drawable is not a native X11 window

And then nothing happens, I have to Ctrl+C to get out of it.

Then, on a second attempt, seems become very weird. If the previous attempt was from the terminal, then it doesn’t work as above. However, if the previous failed attempt was from the desktop entry, then it does work whether trying from the terminal or the desktop entry.

After this, it goes back to square one. So, I have a work-around for now (just launch it twice from the desktop entry), but this is far from ideal and could confuse people if I’m not the only one affected.

@ArchangeGabriel
Copy link
Author

OK, I’ve partly fixed it, the issue was the missing riot.png file. Adding it made it work (so sorry for the noise about this part), however it also enabled a tray icon that can’t be interacted with and makes Ctrl+Q the only way to exit the app (closing the window results in a tray icon staying indefinitely with means of interaction). Should I open a new issue or is #2799 somehow already tracking that?

@dbkr
Copy link
Member

dbkr commented Feb 4, 2017

Yep, this does sounds like problems caused by the new tray icon. I suspect it's not allowing interaction with the tray icon which means you don't get the menu / app focusing behaviour when you click the tray icon.

What desktop environment are you using? Can you interact with other tray icons in your desktop environment, and if so in what way?

@ArchangeGabriel
Copy link
Author

I’m running KDE’s Plasma 5… I can definitively interact with other tray icons, they all have different behaviours but most of them have left and right-click menus (plus hover display, which Riot does have too, displaying a pixelized icon with “electron” as text, see the attached picture).

tray-hover

@ara4n ara4n added S-Major Severely degrades major functionality or product features, with no satisfactory workaround P1 Z-Platform-Specific S-Critical Prevents work, causes data loss and/or has no workaround P2 and removed S-Major Severely degrades major functionality or product features, with no satisfactory workaround P1 S-Critical Prevents work, causes data loss and/or has no workaround labels Feb 9, 2017
@ArchangeGabriel ArchangeGabriel changed the title Strange behaviour when starting riot (desktop version based on electron) Impossible to interact with the tray icon and thus to quit the app (desktop version based on electron) Feb 18, 2017
@ArchangeGabriel
Copy link
Author

Another user reported the same issue, on Plasma 5 too.

@kbg
Copy link

kbg commented Feb 27, 2017

I had the same issues on Plasma 5. Installing the libappindicator-gtk3 package on Arch Linux solved this problem for me.

I am now able to interact with the tray icon using the right mouse button. Unfortunately this also introduced an issue rendering the icon: When libappindicator-gtk3 is installed, only the upper left corner of the riot icon is displayed in the system tray. If I remove the libappindicator-gtk3 package (and restart the riot app), the full icon is shown again, but it cannot be interacted with.

In case this is a packaging issue: I built the Riot Desktop package using the build script from AUR, which currently uses version 0.9.7 of riot-web.

@ArchangeGabriel
Copy link
Author

ArchangeGabriel commented Mar 27, 2017

Hum indeed, using libappindicator-gtk3 allows to interact with the icon, but then its rendering is wrong.

@t3chguy
Copy link
Member

t3chguy commented Jun 12, 2017

I fixed this for myself on KDE Neon (Ubuntu + Plasma) by using equivs-control to make a dummy libappindicator1 and installing it

@MurzNN
Copy link
Contributor

MurzNN commented Jul 12, 2017

@t3chguy can you describe more detaily how to fix this problem on Ubuntu with KDE5?

@t3chguy
Copy link
Member

t3chguy commented Jul 12, 2017

@MurzNN install https://riot.ovh/_matrix/media/v1/download/riot.ovh/RrwsYrxMcIyHWjfhpxxWtvEN over libappindicator1, this is a dummy package I made using equivs-control, you are free to make your own if you don't trust mine. It provides libappindicator1 at an inflated version to replace any installed with a no-op package.

@MurzNN
Copy link
Contributor

MurzNN commented Jul 13, 2017

@t3chguy thanks, it helps! At now tray icon looks and works well on Ubuntu 14.04 with KDE 4.14! Also solves the problem on Ubuntu 16.04+ with KDE5 too.

@t3chguy t3chguy changed the title Impossible to interact with the tray icon and thus to quit the app (desktop version based on electron) Impossible to interact with the tray icon and thus to quit the app (desktop version based on electron) (and weird icon issue) Sep 27, 2017
@z3ntu
Copy link
Contributor

z3ntu commented Sep 27, 2017

Can confirm that removing libappindicator3-gtk makes the icon look not-zoomed in but the resolution of the tray icon is very bad and looks pretty ugly it's current form.

@ArchangeGabriel
Copy link
Author

I confirm too that removing libappindicator3-gtk now results in a working tray icon but very blurred. At least we can interact with it and the notification badge works.

@mnn
Copy link

mnn commented Jul 31, 2018

Got same issue - icon is a purple box (and left click does nothing, not sure if that is correct behaviour). @lazToum's workaround seems to work (at least when launching from a console), I'll modify the autostart file and hopefully it will fix the issue for good.

@MurzNN
Copy link
Contributor

MurzNN commented Aug 6, 2018

@lazToum workaround solve the problem only with icon size, but left click on tray icon is still broken (shows Show/Hide, Quit menu like in right click, instead of immediately show-hide app). So most comfortable solution is removing or replacing via dummy package all libappindicator* packages, or remove manually /usr/lib/x86_64-linux-gnu/libappindicator*.so.1 files.

@shirishag75
Copy link

would having ayatana-appindicator help in anyway instead of libappindicator ? https://github.com/AyatanaIndicators/libayatana-appindicator. See https://wiki.debian.org/Ayatana/IndicatorsTransition

@t3chguy
Copy link
Member

t3chguy commented Sep 15, 2018

It's not something we get control of, it's something electron-builder specifies

@akontsevich
Copy link

akontsevich commented Oct 31, 2018

XDG_CURRENT_DESKTOP=Unity riot-desktop

@lazToum where to set this?

@saligari
Copy link

saligari commented Jan 9, 2019

@akontsevich run that command: XDG_CURRENT_DESKTOP=Unity riot-desktop
to run Riot client and get the correct displaying icon.

@akontsevich
Copy link

@ChrisP4 it solves only icon look but does not fix tray behavior on mouse click. Also DE session manager does not store exact app command to rerun and icon still ugly on next DE start on session restore.

@532910
Copy link
Contributor

532910 commented Jan 9, 2019

without XDG_CURRENT_DESKTOP:
image

with XDG_CURRENT_DESKTOP=Unity:
image

@532910
Copy link
Contributor

532910 commented Jan 9, 2019

Enlightenment 22.4

@Pointedstick
Copy link

This is working properly for me now in KDE Plasma 5.15 with Riot 1.0.1. Can anyone confirm?

@akontsevich
Copy link

@Pointedstick, what works for You? For me in KDE Plasma 5.15 with Riot 1.0.1 works only with right mouse click - opens context menu, left mouse to show main window does not work.

@z3ntu
Copy link
Contributor

z3ntu commented Feb 23, 2019

Both works for me with Plasma 5.15.1 and Riot 1.0.1 on Arch Linux

@ArchangeGabriel
Copy link
Author

With or without appindicator?

@akontsevich
Copy link

Probably they does not use libappindicator. Does not work for me with libappindicator1 - forced to use for acestreamengine. Many distributions use patched libappindicator, hope openSUSE will patch or replace it as well.

@z3ntu
Copy link
Contributor

z3ntu commented Feb 23, 2019

I do not have appindicator installed (only the gtk2 version)

@ArchangeGabriel
Copy link
Author

@akontsevich Then your issue is https://bugs.archlinux.org/task/59652.

@dos1
Copy link

dos1 commented Apr 25, 2019

The correct way to have system tray icon properly working is to use Electron 5.0 or later and have libappindicator installed (but making sure that it doesn't use any patches that actually break it, like it's the case with Arch right now). Also, the app itself shouldn't have any special behavior when it detects KDE, like scaling down the icon to 22x22 - this was "helping" with old buggy Electron (or very old KDE), but now it just makes the icon blurry.

There were multiple bugs in various places that were hindering the usability of systray icons in Electron apps, so you have to make sure all of these pieces are covered.

@532910
Copy link
Contributor

532910 commented Apr 25, 2019

% dpkg -l | grep libappindicator   
ii  gir1.2-appindicator3-0.1:amd64        0.4.92-7                             amd64        Typelib files for libappindicator3-1
ii  libappindicator1:amd64                0.4.92-7                             amd64        allow applications to export a menu into the panel
ii  libappindicator3-1:amd64              0.4.92-7                             amd64        allow applications to export a menu into the panel -- GTK3 version

@dos1
Copy link

dos1 commented Apr 25, 2019

@532910 Your issue seems to be separate and I'd suspect a bug in Enlightenment there. Do other, non-electron apps that use libappindicator work with E?

@532910
Copy link
Contributor

532910 commented Apr 25, 2019

xfce4-panel: no icon
trayer: no icon
but volumeicon-alsa works everywhere

@dos1
Copy link

dos1 commented Apr 25, 2019

Neither trayer nor xfce4-panel seem to support indicators, so as soon as there's any registrar running it's expected that there won't be any icon displayed there, as it won't fallback to XEmbed (and even if it fallbacks, it will be shown only in one panel at a time).

[edit] With xfce4-panel seems like you can use xfce4-indicator-plugin

@t3chguy
Copy link
Member

t3chguy commented May 6, 2022

Are people still experiencing this?

@ArchangeGabriel
Copy link
Author

It works for me both with and without libappindicator installed (though with libappindicator, both right and left click open the menu, while without it right click is the menu and left shows/hides element).

@weeman1337
Copy link
Contributor

Thank you for opening an issue. Unfortunately I wasn’t able to reproduce it. If you keep experiencing this defect, please update your description with steps/screenshots/video/more details and add a comment with @weeman1337 to let me know that it’s ready to be reopened.

@weeman1337 weeman1337 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Electron P2 S-Major Severely degrades major functionality or product features, with no satisfactory workaround X-Cannot-Reproduce Z-Platform-Specific
Projects
None yet
Development

No branches or pull requests