On Thu, 21 Apr 2022 17:47:12 GMT, Alexander Zvegintsev <azveg...@openjdk.org> 
wrote:

> Looks like this test was written based on assumption that SystemTray is 
> supported on all platforms.
> 
> However on Linux it may not be true. 
> 
> Availability of SystemTray is detected by getting owner of `_NET_SYSTEM_TRAY` 
> selection:
> 
> https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/java.desktop/unix/classes/sun/awt/X11/XSystemTrayPeer.java#L42
> 
> https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/java.desktop/unix/classes/sun/awt/X11/XSystemTrayPeer.java#L58-L59
> 
> 
> As an example, SystemTray is not available on Wayland because of this.
> 
> 
> 
> So I modified the test:
> 
> - WIndows and macOS: expecting available SystemTray.
> - Linux: check absence/presence of `UnsupportedOperationException` exception 
> of `SystemTray.getSystemTray()` call  based on `SystemTray.isSupported()` 
> result.
> 
> Testing is green on all platforms.

Marked as reviewed by serb (Reviewer).

-------------

PR: https://git.openjdk.java.net/jdk/pull/8346

Reply via email to