The solution is pretty simple, Step by step guide to fix screen sharing on Ubuntu 22.04.
Step 1: Check the Default Display Feature
To check the current Ubuntu display, run the following command.
echo $XDG_SESSION_TYPE
If your system is Ubuntu 22.04, its display session is Wayland. Now you have to disable Wayland and enable “Xorg”(x11)
Step 2: Enable “Xorg” and disable “Wayland”
Open gdm3 directory to edit the “custom.conf” file by the following command.
sudo vi /etc/gdm3/custom.conf
Uncomment the following line.
WaylandEnable=false
Step 3: Reboot the system
Now reboot or restart your system to apply the changes. After rebooting you can share your screen on zoom, ms team, etc.
You can confirm the changes by running the following command again.
echo $XDG_SESSION_TYPE
If you correctly change the conf file, it will show you display x11.