After some compare with my Debian Jessie netbook and reading about xdg in general I compared raspbian and jessie (my netbook) exports:
Netbook Debian Jessie
>export -p|grep XDG
declare -x XDG_CONFIG_DIRS="/etc/xdg"
declare -x XDG_CONFIG_HOME="/home/hgode/.config"
declare -x XDG_CURRENT_DESKTOP="LXDE"
declare -x XDG_DATA_DIRS="/usr/local/share:/usr/share:/usr/share/gdm:/var/lib/menu-xdg:/usr/local/share/:/usr/share/:/usr/share/gdm/:/var/lib/menu-xdg/"
declare -x XDG_GREETER_DATA_DIR="/var/lib/lightdm/data/hgode"
declare -x XDG_MENU_PREFIX="lxde-"
declare -x XDG_RUNTIME_DIR="/run/user/1000"
declare -x XDG_SEAT="seat0"
declare -x XDG_SEAT_PATH="/org/freedesktop/DisplayManager/Seat0"
declare -x XDG_SESSION_ID="1"
declare -x XDG_SESSION_PATH="/org/freedesktop/DisplayManager/Session0"
declare -x XDG_VTNR="7"
raspbian:
$ export -p|grep XDG
declare -x XDG_RUNTIME_DIR="/run/user/1000"
declare -x XDG_SESSION_ID="c5"
Not that much.
Running update-menus -v -d on the raspbian says:
update-menus -v -d
update-menus[1313]: Update-menus is run by user.
update-menus[1313]: Dpkg is not locking dpkg status area, good.
update-menus[1313]: Reading installed packages list...
update-menus[1313]: Reading translation rules in /etc/menu-methods/translate_menus.
update-menus[1313]: Reading menu-entry files in /home/pi/.menu.
update-menus[1313]: 0 menu entries found (0 total).
update-menus[1313]: Reading menu-entry files in /etc/menu.
update-menus[1313]: 0 menu entries found (0 total).
update-menus[1313]: Reading menu-entry files in /usr/lib/menu.
update-menus[1313]: 0 menu entries found (0 total).
update-menus[1313]: Reading menu-entry files in /usr/share/menu.
update-menus[1313]: 64 menu entries found (64 total).
update-menus[1313]: Reading menu-entry files in /usr/share/menu/default.
update-menus[1313]: 0 menu entries found (64 total).
update-menus[1313]: Running menu-methods in /home/pi/.menu-methods.
update-menus[1313]: Running menu-methods in /etc/menu-methods.
update-menus[1313]: Running method: /etc/menu-methods/xdg-desktop-entry-spec-sessions
update-menus[1313]: Running method: /etc/menu-methods/menu-xdg
update-menus[1313]: Running method: /etc/menu-methods/xdg-desktop-entry-spec-apps
update-menus[1313]: Running method: /etc/menu-methods/openbox
update-menus[1313]: Running method: /etc/menu-methods/xdg-desktop-entry-spec-dirs
but there are no items listed in the applications menu except Preferences and Shutdown. Does update-meus use default dirs or the ones set with export XDG_...?
I renamed the existing .menu files in /home/pi/.config/menus/ to ".menu.bak" and re-run update-menus and the Applications menu was filled with the entries. Then there was also a new file "debian-menu.menu".
ls -l .config/menus/
total 32
-rw-r--r-- 1 pi pi 4964 Jan 10 18:10 applications.menu.bak
lrwxrwxrwx 1 pi pi 48 Jan 10 17:55 applications-merged -> /home/pi/.config/menus/lxde-pi-applications.menu
-rw-r--r-- 1 pi pi 4964 Jan 11 17:52 debian-menu.menu
-rw-r--r-- 1 pi pi 4964 Jan 11 17:44 debian-menu.menu.bak
-rw-r--r-- 1 pi pi 1067 Jan 10 19:15 lxde-pi-applications.menu.bak
So, XDG_CURRENT_DESKTOP seems to default to "debian". But a test with XDG_CURRENT_DESKTOP="LXDE-PI" did not create a new lxde-pi-applications.menu file.
Still curious about how xdg builds the menu. But I am now OK with having back the debian applications inside the Applications menu.
I can reproduce the issue by starting alacarte (Main Menu Editor) and adding a new sub and new menu item: the applications menu will be cleared (alacarte still showing all). Then there is a new lxde-pi-applications.menu file at .config/menus/. After deleting the file and running update-menus the applications menu is filled up again.
Edit2: BTW: using lxmed does work on adding a custom menu and item and the applications menu is not cleared.