Took a while to investigate.
The xdg-open app is a shell script, part of xdg-utils. On Slackware the file is installed to /usr/bin.
The script offers no support for Trinity. Perusing the script indicates a poorly written script rather than anything robust. No error-checking or "idiot-proofing" at all. The script provides no optional methods of detecting the desktop. The presumed desktops are hard-coded and the "generic" functions are poorly written.
On my system anything I try to open wih xdg-open is opened in my default browser, Firefox.
I tested in KDE4 and everything works but only because KDE is one of the few supported desktops.
I have no idea why GIMP is opened. The user could edit xdg-open and add some echo statements to help debug.
Setting DE=kde doesn't work in my GIT setup. The reason is in GIT we changed the environment variables, but 3.5.13.x still uses KDE environment variables. Hence the partial success.
Other than submitting a patch for xdg-open to upstream I doubt there is little we can do.
By the way, xdg-mime is another script from xdg-utils and the similar presumptions are in that script. The only supported desktops are KDE, GNOME, Xfce, and LXDE. Otherwise the desktop is presumed to be "generic."
The Arch folks have a discussion about xdg-utils and they say xdg- open is broken.
https://wiki.archlinux.org/index.php/Default_Applications
Searching the web for "xdg-open" indicates the script has been broken through the years. As I wrote, the scripts are not robust and contain limited presumptions. :-)
Darrell