Closed malachid closed 2 years ago
I just tried the tray example out on Ubuntu 18.04 w/ Gnome 3.28.2. Same issue. I get a desktop windows with the "Increment value", but no tray Icon.
EDIT: These frameworks seems to have solved the issue Dorkbox and TornadoFX
@NangiDev is 0.3.0-build134 any better wrt menus?
I tried the tutorial on Fedora 33 with Gnome 38 and the extension TrayIcons Reloaded. It more or less works.
Here are the problems that I observe:
setComposite(AlphaComposite.Clear); fillRect(0,0,size,size); setComposite(AlphaComposite.Src)
to the code of getTrayIcon
(see screenshots below)I must add that I have a 2x scale factor (high dpi) as I use an 4K screen.
@olonho Sorry for slow response. I went with another solution, but just to answer your question I tried the same example project with version 0.3.0-build134 and still no tray menu, but I get the message "The os does not support: 'Taskbar.setIconImage'" in console.
I will try the TrayIcons Reloaded plugin that @ptitjes mentions. Not really an ideal solution for me, but I'm guessing it's more of an Gnome problem than compose-js problem
if you are getting the "The os does not support: 'Taskbar.setIconImage'" error message when running from within IntelliJ; try packaging, installing, and running the program; this was necessary for me on Ubuntu 20.04, though not on Red Hat 8.3 if run directly (unfortunately no packaging yet for rpm, however); also this method works only as a window parameter function, not using the setIcon() method
Based on the comment from @fauxvillage I decided to try that on the notepad example in the repo. Whether running directly from gradle, or building the package and installing it - the tray does not work on it.
Not sure if there is anything we can learn from it, but the tray icon does work on the JetBrains Toolbox app.
Just re-tested this example
https://github.com/JetBrains/compose-jb/tree/master/tutorials/Tray_Notifications_MenuBar_new
on 20.04.2 (a different machine) by running ./gradlew packageDeb
then using sudo apt install -f
on it.
Instead of a tray icon, there was the normal app icon with "Untitled" and "Exit" under it.
If I run ./gradlew run
on JDK11 or JDK16 instead, it says:
Tray is not supported on the current platform. Use global property
isTraySupported
to check.
I saw in https://blog.jetbrains.com/kotlin/2021/08/compose-multiplatform-goes-alpha/ that the Jetbrains Toolbox has been converted to Compose. It still has a tray icon on version "JetBrains Toolbox 1.21.9547, Ubuntu 20.04 (Linux 5.4.0-80-generic)".
I just tested this with the current version on a plain Debian 11.2 Installation with JDK 11 and 17. When I run the https://github.com/JetBrains/compose-jb/tree/master/tutorials/Tray_Notifications_MenuBar_new I get two things:
Context menu works in both scenarios.
Note: Tray only works when this extension is installed: https://extensions.gnome.org/extension/615/appindicator-support/ .
I already had the extension installed; however your timing is great because I had just been testing the same thing in Rust and had needed to do:
sudo apt install libgtk-3-dev
sudo apt install libappindicator3-dev
With those and the extension, I do see the tray now.
Results:
Verified the tray examples on Window_API_new are also working now.
@malachid Glad to here at least sometimes my timing is perfect ;-). I installed the packages, too. But no changes to my original post.
any progress on this? especially having notifications on ubuntu would be good
the notification window that appears when I click on "Send notification" does not conform to platform notifications and is also very-badly rendered and position (see screenshots below)
![]()
I have the same on Ubuntu 23.10, tray works fine but the graphics is horrible
is there anything we can do to help? (guide us where/how to contribute with a PR)
@elect86 i made this until we have a better solution:
https://github.com/zoff99/jni_notifications
example usage is included:
it works on macOS and on Linux. in windows notifications with try seem to work fine with this
Expected Tutorials would work out of the box
Actual
When running the Tray_Notifications_MenuBar tutorials on Ubuntu 18.04, the applications launch but do not function as expected.
There is the standard icon (with an exit option), but none of the application-specified menus. The notifier similarly does not present.
In the same manner, the Windows Attributes tutorial fails, as there are no menu options to click.
When I run this, it confirms that the SystemTray is no longer supported.
I tried TopIconsPlus Gnome shell extension ( as per the Gnome Release notes ) and got the Tray example to work, but not the others. TBH, UI was not great either.
I also tried AppIndicator Gnome shell extension (as per the documentation on https://github.com/dorkbox/SystemTray ). That didn't work for any of the tutorials.
Suggestions
SystemTray.isSupported()
under the hood and directed the user/dev to a wiki on how to fix it. I have not yet managed to fix it myself, so do not have a suggestion on what that option would look like.