linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.53k stars 737 forks source link

System Tray applet problem: cannot right click on certain tray icons #4946

Closed gilbertohasnofb closed 8 years ago

gilbertohasnofb commented 8 years ago

I just upgraded from Linux Mint 17.1 to 17.3 today and while the updated OS looks fantastic, I am experiencing a small but annoying problem with the System Tray applet. Now, when I right click on certain tray icons, I am shown a menu list with "About..." and "Remove this applet" instead of the program options. The main affected program for me is Qjackctl, which is a GUI for the audio driver JACK: basically, if I minimize it, I can't really reopen it since you'd normally do that by right clicking.

ghost commented 8 years ago

left click to use program options

gilbertohasnofb commented 8 years ago

This is the thing: certain programs do not respond to left click, and qjackctl is one of them...

repsac-by commented 8 years ago

Now I have to deploy the program in 2 clicks, first left-click on the icon then I show the window. But if the program has no menu item to show the window, it is not possible to deploy from the system tray. The only way to get it back is disabling the support for the indicators in the “System Settings” -> “General” -> “Enable support for indicators”.

gilbertohasnofb commented 8 years ago

@repsac-by Ok, I will test that, but what are the downsides of disabling that option? Sorry but I am not familiar with it.

gilbertohasnofb commented 8 years ago

Ok, I will test that

It works perfectly well, now qjackctl is accessible via the tray icon. Thanks for the tip.

repsac-by commented 8 years ago

@gilbertohasnofb indicator new type of tray icons. Drawing and processing takes desktop environment. When disabled, the indicators of each application doing it yourself.

ghost commented 8 years ago

The Indicators are really configurables instead of the old behaviours, and then is possible use the indicators with right click and left click as an option. I know could be a little complex for some people if we have the indicators in the unity desktop way, and as is the unity way and not the cinnamon way, i think this thing need to be configurable, because would affect the custom of the users of cinnamon.

There are some improved to the indicators here: https://github.com/linuxmint/Cinnamon/pull/4814

Especially, please pay attention to this commit: https://github.com/lestcape/Cinnamon/commit/ab09e9439ce1048ba9323502fb03d9720c38543e

There are an issue related with open the associate main window when you perform a left click inside the indicator icon, for some indicators. https://github.com/linuxmint/Cinnamon/blob/master/js/ui/indicatorManager.js#L410

I will try to implement this ability in a better different way, but i can't promise anything yet.

Regards.

repsac-by commented 8 years ago

@lestcape Thank you, I'm using your improvements. I had a problem with qbittorrent, if you select monochrome icon, it does not appear, although the color icon is displayed.

ghost commented 8 years ago

@repsac-by yes, probably there are an issue about select the correct icon, but well, I really don't know if what you say is applicable, because one thing is the application-icon and another is the indicator-icon. Are you sure that the icon need to change?

repsac-by commented 8 years ago

@lestcape Selecting the icon provides qbittorrent itself (Normal, Monochrome Dark, Monochrome Light). If you choose any different from Normal, instead of the empty space icons. This happens only when the indicators are enabled.

Normal: q q1

Monochrome: q2a q2

ghost commented 8 years ago

I see, but sorry i can not reproduced this issue: https://youtu.be/qQBd6lueets

repsac-by commented 8 years ago

I rebuilt qbittorrent using qt4 and now all is well. The problem occurs on qt5, which qbittorrent is now the default.

ghost commented 8 years ago

I don't know where is the correct place to report the issue then. Qt, qbittorrent...? The indicator code can not have a reference to the Qt version, i think. I discover some bugs about tooltips when i test the qBittorrent, so thanks.

repsac-by commented 8 years ago

But without your improvements icons are displayed in conjunction with qt5

ghost commented 8 years ago

@repsac-by ok, that's probably this: https://github.com/lestcape/Cinnamon/blob/031a6add37d04e913a47a97b06b741634bf788f3/js/ui/indicatorManager.js#L1000

Can you remove this last condition and test it again?

repsac-by commented 8 years ago

I removed

&& !this._indicator.isInBlacklist()

restart cinnamon

Nothing has changed, no monochrome icon

repsac-by commented 8 years ago

I found that the problem in the last commit 233d07f9fa957c810b9e877ae1a43119d10a5806 I did git revert and fix it.

ghost commented 8 years ago

Ok thanks. The last condition is an error anyway. Can you tell me if you see something in your logs files?

~/.xsession-errors and ~/.cinnamon/glass.log

repsac-by commented 8 years ago

Only this error. When hover is on indicators.

(cinnamon:25743): Cjs-WARNING **: JS ERROR: Error: Expected type utf8 for Argument 'text' but got type 'object' Tooltip.prototype.set_text@/usr/share/cinnamon/js/ui/tooltips.js:200 Applet.prototype.set_applet_tooltip@/usr/share/cinnamon/js/ui/applet.js:260 MyApplet.prototype._onEnterEvent@/usr/share/cinnamon/applets/systray@cinnamon.org/applet.js:142

repsac-by commented 8 years ago

This is causing the problem https://github.com/lestcape/Cinnamon/commit/233d07f9fa957c810b9e877ae1a43119d10a5806?diff=unified#diff-05db65ea5625e393ffab82cc7a763e9cR1198

I removed line 1198

style_class: 'applet-icon',

and monochrome icon is visible

ghost commented 8 years ago

@repsac-by yes i see the same. I will need to get an St.Icon instead of a Clutter.Actor here:

https://github.com/lestcape/Cinnamon/commit/233d07f9fa957c810b9e877ae1a43119d10a5806?diff=unified#diff-05db65ea5625e393ffab82cc7a763e9cR1197

ghost commented 8 years ago

You can test if now is working. I really not test this, any way thanks.

repsac-by commented 8 years ago

Tested, works fine. Thanks.

ikuria commented 8 years ago

sry i have the same problem with my skype qt icon in the cinnamon systray applet, on right click i get "about" and "remove this applet" what can i do to change this?

repsac-by commented 8 years ago

@ikuria you need to merge master and lestcape-patch-1 Build the package with the cinnamon for your distribution, install it and restart cinnamon.

ikuria commented 8 years ago

hmm sadly i dont know how to do that xD

gilbertohasnofb commented 8 years ago

Strange, my Skype has always worked with the new Systray applet, both before and after disabling the support for the indicators.

ikuria commented 8 years ago

gilbertohasnofb do you use skype with sni-qt or without? without i have no problems too, but for the qt tray icons we have no right click, - but now we have with this patch i dont know to install xD

gilbertohasnofb commented 8 years ago

@ikuria Oh sorry, my bad, I didn't understand you were using sni-qt. No, I don't use it.

ghost commented 8 years ago

@ikuria an easy way without need to know several things is:

1- Create a backup of this files (just in case):

2- sudo gedit /usr/share/cinnamon/js/ui/dbusMenu.js and replace all the file contents for this: https://github.com/lestcape/Cinnamon/blob/lestcape-patch-1/js/ui/dbusMenu.js 3- sudo gedit /usr/share/cinnamon/js/ui/indicatorManager.js and replace all the file contents for this: https://github.com/lestcape/Cinnamon/blob/lestcape-patch-1/js/ui/indicatorManager.js 4- Find and replace this text:

let behavior = global.settings.get_boolean("right-click-indicators");

if you want the left click behaviour by this:

let behavior = true;

or if you want the right click behaviour by this:

let behavior = false;

4- sudo gedit /usr/share/cinnamon/js/ui/main.js and replace all the file contents for this: https://github.com/lestcape/Cinnamon/blob/lestcape-patch-1/js/ui/main.js

5- sudo gedit /usr/share/cinnamon/applets/systray@cinnamon.org/applet.js and replace all the file contents for this: https://github.com/lestcape/Cinnamon/blob/lestcape-patch-1/files/usr/share/cinnamon/applets/systray%40cinnamon.org/applet.js

6- Restart cinnamon.

If you have some problems and you can not come back, then reinstall cinnamon.

Regards.

ikuria commented 8 years ago

thanks for the xmas-gift, worked well one question: skype is not opening in front, is that a problem inside skype or your scriptpatch?

ghost commented 8 years ago

I update my comment, you need to set:

let behavior = true;

Also see: There are an issue related with open the associate main window when you perform a left click inside the indicator icon, for some indicators. https://github.com/linuxmint/Cinnamon/blob/master/js/ui/indicatorManager.js#L410 I say this in this comment: https://github.com/linuxmint/Cinnamon/issues/4946#issuecomment-165961847

The real reason is there:

See this: http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem/

"Activate

VOID org.freedesktop.StatusNotifierItem.Activate (INT x, INT y);

Asks the status notifier item for activation, this is typically a consequence of user input, such as mouse left click over the graphical representation of the item. The application will perform any task is considered appropriate as an activation request.

the x and y parameters are in screen coordinates and is to be considered an hint to the item where to show eventual windows (if any)."

As you can read in the reference: "The application will perform any task is considered appropriate as an activation request". What occurs in unity is that they apply a patch in this function to always do what they want. So, this is the reason of this can work ok in unity and not in cinnamon.

Any way is working ok with the version of skype that i have.

ghost commented 8 years ago

Sorry, with skype, there are a focus problem, but the signal is received. I don't know if this is a problem of muffin, or an skype devs decision.

ghost commented 8 years ago

Also see that same occurs if we used the equivalent option inside the Skype indicator menu. If the Skype windows don't have the focus then nothing happen.

ManuelSchneid3r commented 8 years ago

This title is not saying anything about the issue. Please give a precise and concise description of the problem. Please think of the users that are searching a potential duplicate of the issue they want to report and have to open and read all those "I have a problem" issues.

gilbertohasnofb commented 8 years ago

@ManuelSchneid3r :+1:

Also, I think this issue can be closed, as it was solved for me long time ago (and apparently for other people in this discussion as well).