xdg-open doesn't properly detect Xfce/Xubuntu

Bug #1388922 reported by Danila Poyarkov on 2014-11-03
80
This bug affects 14 people
Affects Status Importance Assigned to Milestone
Xdg-utils
Fix Released
Medium
xdg-utils (Ubuntu)
Undecided
Sean Davis

Bug Description

xdg-open doesn't detect the XFCE desktop environment on its fresh install on Ubuntu (not Xubuntu).
I was able to fix that by adding 'elif [ x"$DESKTOP_SESSION" = x"xubuntu" ]; then DE=xfce;' line in 'detectDE()' function.

it seems that "xprop -root _DT_SAVE_MODE" doesn't work anymore

Works fine for me:
$ xprop -root _DT_SAVE_MODE
_DT_SAVE_MODE(STRING) = "xfce4"

Reporter, what does
xprop -root _DT_SAVE_MODE
report for you then?

and what version of xdg-utils are you using?

I suppose we could fallback to try $DESKTOP_SESSION env, on my xfce-4.6 environment, it reports

$ echo $DESKTOP_SESSION
xfce4

(and apparently xfce 4.8 returns just 'xfce', but I'd like to confirm if you see that too)

xprop -root _DT_SAVE_MODE is used by xdg-open script to detect that currently running DE is xfce. For me it worked fine in xfce 4.6, but in 4.8 it doesn't work.

$ echo $DESKTOP_SESSION
xfce

(not xfce4)

I'm using xdg-utils 1.0.2 in Arch

Sorry, forgot to paste this:

$ xprop -root _DT_SAVE_MODE
_DT_SAVE_MODE: no such atom on any window.

Confirming this problem. I use Archlinux as the reporter. People, it's really serious, Chromium opens all files in Mozilla Firefox (!!) and Xarchiver does the same. I had to manually edit all xdg-* scripts (can't send a patch because it's a dirty hack :)

I'd suggestion someone with contact with xfce upstream... ask them how best to detect it.

mkkot, as a workaround I would suggest to make "export DE=xfce" somewhere. This act as a fallback entry for xdg-open when desktop environment isn't detected.

Bug #25941 seems to be related.

(In reply to comment #9)
> mkkot, as a workaround I would suggest to make "export DE=xfce" somewhere. This
> act as a fallback entry for xdg-open when desktop environment isn't detected.

This doesn't work since this commit: http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=c9551d250722081cbf7d6611f417bc597765e5c9 .

In retrospect, I'm unsure of the wisdom of clearing DE in that referenced commit. Perhaps that portion should be reverted (unless there was some good reason for it, that I fail to fathom).

(In reply to comment #11)
> In retrospect, I'm unsure of the wisdom of clearing DE in that referenced
> commit. Perhaps that portion should be reverted (unless there was some good
> reason for it, that I fail to fathom).

Totally agree, I had to remove this line so that my workaround with "export DE=xfce" could work again.

Commenting out this DE clearing helped me. It doesn't overwrite my "export DE=xfce" in .xinitrc. Ideally there should be a check if it was already defined manually.

this should hopefully do the trick:

http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=a9d65ff51ce0dd40cf0cb39b0f3c36dca100c527

For posterity, I would still appreciate someone investigate why/how xprop fails on some platforms and/or ping xfce upstream for a better or proper way to detect it's use.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xdg-utils (Ubuntu):
status: New → Confirmed
Changed in xdg-utils:
importance: Unknown → Medium
status: Unknown → Fix Released

a pacth to attempt a correction for this bug

The attachment "bug1388922.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
summary: - xdg-open doesn't properly detect XFCE DE
+ xdg-open doesn't properly detect Xfce/Xubuntu
tags: removed: patch
Jamin W. Collins (jcollins) wrote :

The patch referenced in post #17 won't correct this issue.

It's adding the following condition:
x"$DESKTOP_SESSION" = x"xfce"

However, that's not the value of DESKTOP_SESSION:

$ env | grep DESKTOP
DESKTOP_SESSION=xubuntu
XDG_SESSION_DESKTOP=xubuntu
XDG_CURRENT_DESKTOP=XFCE

A more correct check would be against XDG_CURRENT_DESKTOP

Michael MacEachern (maceach-b) wrote :

Can we finally fix this please? This still isn't working correctly in 15.04, and I still have to modify xdg-open.

Johan Gunnarsson (johang) wrote :

Still happens on Xubuntu 15.04, but fixed upstream.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdg-utils - 1.1.0~rc3+git20150907-1ubuntu1

---------------
xdg-utils (1.1.0~rc3+git20150907-1ubuntu1) wily; urgency=low

  * Merge from Debian unstable. Remaining changes: (LP: #1495273)
    - debian/patches:
      * gnome-3.0.diff: Correctly open preferred browser with
        gnome-open (LP: #670128)
      * lp779156-lubuntu.diff: Add open_lxde and run_sylpheed function
        for improved LXDE and sylpheed support (LP: #779156)
      * xdg-screensaver-restore-timeout.diff: restore previous X11
        screensaver timeout when xdg-screensaver resume is used (LP: #1363540)
  * New upstream release fixes the following bugs:
    - xdg-mime query filetype does not work on KDE 5 (LP: #1454833)
    - xdg-open doesn't properly detect Xfce/Xubuntu (LP: #1388922)
    - xserver-blanking patch in Ubuntu duplicates code (LP: #1330386)
    - Typo in manpage of 'xdg-icon-resource' (LP: #996304)
    - xdg-open (to gnome-open) fails to launch file:// URL with query string
      (LP: #396162)

 -- Sean Davis <email address hidden> Sun, 13 Sep 2015 12:39:10 -0400

Changed in xdg-utils (Ubuntu):
status: Confirmed → Fix Released
Pasi Lallinaho (knome) on 2015-09-15
Changed in xdg-utils (Ubuntu):
assignee: nobody → Sean Davis (bluesabre)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.