Re: How to detect a gtk desktop programmatically



On Wed, 29 Apr 2020 at 15:27:02 -0400, Tres Finocchiaro via desktop-devel-list wrote:
For reference, the commit which introduced this change:
[1]https://gitlab.gnome.org/GNOME/gnome-session/commit/
00e0e6226371d53f651cc881e74c0543192c94a8#
5b3005b925ed5c2612a9604ad3c756b1f9472165

Note, at the time of committing that, Debian still had 225 instancesĀ of the OS
relying on this for detection of a Gtk-desktop (such as the mail launcher to
prefer Evolution to KMail, etc).

Debian's gnome-session package carries a patch to revert that commit,
unfortunately. We'd like to stop doing that, but as you say, there are
at least 225 instances of packages doing it wrong.

However, with or without that patch, anything that is looking at
the deprecated GNOME_DESKTOP_SESSION_ID and expecting its absence or
presence to indicate "non-GTK-based desktop" vs. "GTK-based desktop"
is certainly a bug - not just because newer GNOME no longer sets
GNOME_DESKTOP_SESSION_ID, but also because there are several GTK-based
desktops that are not GNOME.

LXDE (before Qt) and XFCE are examples of desktop environments that you
would probably consider to be "GTK-based", but are not GNOME (not even
forked or derived from GNOME - they are their own thing, only sharing
lower-level libraries like GLib and GTK). They set XDG_CURRENT_DESKTOP to
something that doesn't mention GNOME, and they don't set
GNOME_DESKTOP_SESSION_ID, because they are not GNOME, and claiming to
be GNOME would be inappropriate.

MATE, Cinnamon and Deepin are examples of desktop environments based on
a fork of an older version of GNOME, but which are not GNOME *any more*;
again, they don't set XDG_CURRENT_DESKTOP to GNOME or anything containing
GNOME, because they are their own independent desktop environments.

I would recommend that Java GUI apps running on Linux (and probably
all Unix platforms) should use whichever "look and feel" is considered
to be high-quality and doesn't look hugely out-of-place. If the GTK
"look and feel" is considered high-quality, it should probably be used
everywhere. If it's considered low-quality (lots of bugs or missing
functionality or whatever), then it would likely be better to use one
that *is* high-quality, even if it doesn't visually resemble other apps
on the desktop.

Firefox and Libreoffice use GTK everywhere. If it's good enough for them,
it's likely also good enough for Java.

    smcv


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]