No. They incorporated a way for Wayland applications to display using rootless remote desktop and X11 applications simply work through XWayland running on WSL2 (as can be seen here).
Thanks for the link, very informative.
Since there is no direct X11 'over the wire' between WSLg and the Windows host, I started Cygwin/X on Windows and tried again. After setting DISPLAY and copying over Cygwin/X's .Xauthority file from Windows to Linux, X11 programs like gvim and Lazarus failed to connect to the X display server. Probably measures to protect the X server against network attacks. Or maybe I need to muck around with Windows firewall rules.
Anyways,, I started a 'local' (meaning on Windows Cygwin/X) xterm, ssh from it to WSL2 Ubuntu with X11 forwarding, then run 'startlazarus'. This time, the 'install / uninstall package' dialog box was usable, and I could select anchordockingdsgn and click 'rebuild IDE'.
BUT! When Lazarus restarted, it failed to paint its window properly, got stuck in partial full screen, was not responsive to mouse, and haphazardly responded to key presses. The xterm that started the app showed several lines "Gtk-critical: IA_gtk_window_set_keep_above: assertion GTK_IS_WINDOW (window) failed"
WSL2 seems a little harder to use so far, as it doesn't have a desktop environment. I have read that you can add one, but I'm not sure how easy that would be or if it would help.
Depends on how you use. When I tried it few months back, the full desktop X environment ran full screen, with its own login screen, just like running Linux-in-a-VM in full screen mode. Needed to press a hot key to escape from the X desktop to get back to Windows. Not for me. I prefer to be able to alt-tab through both Windows and X windows.
But, given what I wrote on failing to run Lazarus in integrated windows mode, maybe you can try the full X desktop mode.
Am I right in thinking that if you install anything from .deb files you have to update manually?
Yes. You mentioned in your earlier post that you plan to build your own from source. Installing from the .deb files gives you the FPC for bootstrapping. Once you have built your own versions, you could uninstall the .deb version.