Yes. This problem was resolved as a paid support request off-list, thanks for summarizing the final solution on the forum. I think the default GUI session type was changed to Wayland starting with Ubuntu 21.10 for new installations or new users, so anybody starting with a freshly installed Ubuntu 22.04, or creating a new user account on such a machine, will run into this, at least under Matlab.
To make things easier in the future, the latest PTB 3.0.18.8 release from yesterday therefore now detects this scenario and aborts, while giving troubleshooting advice to login into a X-Server based GUI instead.
Wayland, while maybe ok for standard desktop use cases, is still in insufficient shape for many (most?) non-trivial neuroscience applications, as of Ubuntu 22.04, and I expect it to stay that way possibly for years to come. Lots of functionality for non-mainstream use cases like ours is still missing, with relevant protocol design discussions sometimes drawing out over years.
PTB on Octave on Ubuntu 22.04 would switch to our experimental Wayland backend, which on second thought, as I am writing this, is probably not the smartest thing to do by default. I will have to reverse that behavior and make Wayland strictly opt-in in one of the next PTB releases. Nobody should use Wayland with PTB yet, apart from myself for testing… Current PTB isn’t yet fine-tuned for Ubuntu 22.04, but hopefully soon.
EDIT: Fix released for consistent behaviour on Octave and Matlab with PTB 3.0.18.9.
However, the new X11/XOrg X-Server 21.1 shipping in Ubuntu 22.04 gained some useful improvements for neuroscience applications, a few of them contributed by myself in the 2nd half of last year.
-mario