This psstree
command displays the window manager(s) presently use. And group the result(s) per application and their relationships with other item(s).
Below is the same answer as above. But with details if you're interested in those.
Three steps:
If not already done, execute this command to install the "pstree" package
sudo apt-get install pstree
Using Terminal/Command line, execute this command
psstree
Within the result, search for the keyword "gdm". On the right side of "gdm" is the presently use Window Manager. For example:
gdm-wayland-ses─┬─gnome-session
Means GNOME Wayland
gdm-x-session─┬─Xorg
Means GNOME X11
One of the main benefit of pstree is that if you have mutliple Window Manager use at once, then pstree will display which Window Manager is use per application. Plus the application relationship with other items.
pstree has many optional parameters. For example, execute this command to display only trees rooted at processes of this user
Format: pstree <USERNAME>
Example: pstree jdoe