8153512: Taskbar support reported for Xfce4

Reviewed-by: alexsch, ssadetsky
This commit is contained in:
Alexander Zvegintsev 2016-07-13 12:24:24 +03:00
parent b15c691620
commit b0db527992

View File

@ -32,6 +32,7 @@ import java.awt.event.ActionEvent;
import sun.awt.UNIXToolkit;
import java.security.AccessController;
import java.security.PrivilegedAction;
import sun.security.action.GetPropertyAction;
final class XTaskbarPeer implements TaskbarPeer {
@ -40,6 +41,14 @@ final class XTaskbarPeer implements TaskbarPeer {
private static boolean initExecuted = false;
private PopupMenu menu = null;
private static boolean isUnity;
static {
String de = AccessController.doPrivileged(
(PrivilegedAction<String>) ()
-> System.getenv("XDG_CURRENT_DESKTOP"));
isUnity = de != null && de.equals("Unity");
}
private static void initWithLock() {
XToolkit.awtLock();
@ -68,6 +77,9 @@ final class XTaskbarPeer implements TaskbarPeer {
}
static boolean isTaskbarSupported() {
if (!isUnity) {
return false;
}
initWithLock();
return nativeLibraryLoaded;
}