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

Open
ArchangeGabriel opened this Issue Feb 4, 2017 · 25 comments

Comments

Projects
None yet
@ArchangeGabriel
Copy link

ArchangeGabriel commented Feb 4, 2017

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

This comment has been minimized.

Copy link
Author

ArchangeGabriel commented Feb 4, 2017

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

ArchangeGabriel commented Feb 5, 2017

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

@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

This comment has been minimized.

Copy link
Author

ArchangeGabriel commented Feb 18, 2017

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

@kbg

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Contributor

MurzNN commented Jul 12, 2017

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

@t3chguy

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

ArchangeGabriel commented Oct 16, 2017

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.

@ArchangeGabriel

This comment has been minimized.

Copy link
Author

ArchangeGabriel commented May 20, 2018

Apparently blurry tray icon for electron apps under KDE is a common bug, not specific to Riot (and I can confirm I also have this issue with other apps). Same goes for wrong size when libappindicator is installed. For instance cozy-labs/cozy-desktop#990.

@MurzNN

This comment has been minimized.

Copy link
Contributor

MurzNN commented May 20, 2018

In cozy-labs/cozy-desktop#990 there are workaround that solve this KDE bug:

I have patched the code to use a 22*22 icon size when KDE environment is detected.

Maybe Riot can do the same thing?

@MurzNN

This comment has been minimized.

Copy link
Contributor

MurzNN commented Jun 6, 2018

Quck fix for Riot Electron app tray icon in Kubuntu (Ubuntu KDE) and Debian Linux systems:

mv /usr/lib/x86_64-linux-gnu/libappindicator.so.1.0.0 /usr/lib/x86_64-linux-gnu/libappindicator.so.1.0.0_off

This will work until libappindicator1 package will be upgraded/reinstalled

@lazToum

This comment has been minimized.

Copy link

lazToum commented Jun 18, 2018

on Arch, plasma 5.13 with libappindicator-gtk3:
XDG_CURRENT_DESKTOP=Unity riot-desktop

@mnn

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

shirishag75 commented Sep 14, 2018

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

@t3chguy

This comment has been minimized.

Copy link
Collaborator

t3chguy commented Sep 15, 2018

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

@akontsevich

This comment has been minimized.

Copy link

akontsevich commented Oct 31, 2018

XDG_CURRENT_DESKTOP=Unity riot-desktop

@lazToum where to set this?

@ChrisP4

This comment has been minimized.

Copy link

ChrisP4 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

This comment has been minimized.

Copy link

akontsevich commented Jan 9, 2019

@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

This comment has been minimized.

Copy link
Contributor

532910 commented Jan 9, 2019

without XDG_CURRENT_DESKTOP:
image

with XDG_CURRENT_DESKTOP=Unity:
image

@532910

This comment has been minimized.

Copy link
Contributor

532910 commented Jan 9, 2019

Enlightenment 22.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment