--- old/src/java.base/unix/native/libjava/java_props_md.c 2021-04-19 18:37:28.014380760 +0530 +++ new/src/java.base/unix/native/libjava/java_props_md.c 2021-04-19 18:37:27.690380765 +0530 @@ -1,5 +1,5 @@ /* - * 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 @@ -457,8 +457,10 @@ #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 {