-
Notifications
You must be signed in to change notification settings - Fork 24
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
SysTrayItem Click Problem #2
Comments
I'm short on time right now, but I've managed to implement a temporary workaround for the issue. What I did was incorporate a try-catch block. Now, when a click occurs, if the icon has an associated action, it will execute seamlessly. If not, it will do nothing without the error. Also I added
|
Actually right now I did not find any solutions. Even after looking into other people's config, I found that they do not use you can change that in the file onPrimaryClick: (btn, event) => {
try {
item.activate(event).catch();
} catch (TypeError) {}
},
onSecondaryClick: (btn) =>
item.menu.popup_at_widget(btn, Gravity.SOUTH, Gravity.NORTH, null), Into onPrimaryClick: (btn, event) => {
item.menu.popup_at_widget(btn, Gravity.SOUTH, Gravity.NORTH, null),
},
onSecondaryClick: (btn) =>
item.menu.popup_at_widget(btn, Gravity.SOUTH, Gravity.NORTH, null), For me I'll stick with the original settings as they error only appears in the log and does not crash anything, I just ignore the action if nothing happens and use the second mouse click. |
Hello Ahmed!
First of all, thank you very much for this excellent work.
I have a problem. An exception occurs when I click on some tray items. For example when I click to the bluetooth icon, it works and opens bluetooth manager application. But when I click on Spotify, NM Applet or Steam, an error occurs. The error is like this:
(com.github.Aylur.ags:377891): Gjs-CRITICAL **: 22:12:50.115: JS ERROR: TypeError: item.activate(...) is undefined SysTrayItem/onPrimaryClick/<@file:///home/kursatufukcoskun/.config/ags/modules/widgets/systray.js:26:14 setTimeout/source<@resource:///org/gnome/gjs/modules/esm/_timers.js:72:9 _init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34
(com.github.Aylur.ags:377891): Gjs-WARNING **: 22:12:50.954: Unhandled promise rejection. To suppress this warning, add an error handler to your promise chain with .catch() or a try-catch block around your await expression. Stack trace of the failed promise: @resource:///org/gnome/gjs/modules/core/overrides/Gio.js:192:20 activate@resource:///com/github/Aylur/ags/service/systemtray.js:40:21 SysTrayItem/onPrimaryClick/<@file:///home/kursatufukcoskun/.config/ags/modules/widgets/systray.js:26:14 setTimeout/source<@resource:///org/gnome/gjs/modules/esm/_timers.js:72:9 _init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34
Operating System: Arch Linux
AGS Version: 1.8.0
What do you think could be the problem? Thanks for your support.
The text was updated successfully, but these errors were encountered: