< prev index next >
src/java.base/unix/native/libjava/java_props_md.c
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -455,12 +455,14 @@
sprops.os_version = strdup(name.release);
#endif /* _AIX */
#endif /* MACOSX */
sprops.os_arch = ARCHPROPNAME;
+ char* curr_desktop = getenv("XDG_CURRENT_DESKTOP");
- if (getenv("GNOME_DESKTOP_SESSION_ID") != NULL) {
+ if (getenv("GNOME_DESKTOP_SESSION_ID") != NULL
+ || (curr_desktop != NULL && strcasestr(curr_desktop, "gnome") != NULL)) {
sprops.desktop = "gnome";
}
else {
sprops.desktop = NULL;
}
< prev index next >