I did some more debugging by echoing $@ at various places and finally narrowed it down to the reading of the profile files that happens at the top of /etc/gdm3/Xsession ...
It turned out my $HOME/.profile file had the line 'set GDK_DISPLAY based on session type', which should have been a comment but wasn't. Hence, this line got interpreted as a command to set $@ ... I guess this issue can be closed. Kind regards, Matijs van Zuijlen
signature.asc
Description: OpenPGP digital signature