No, the compositor is the Wayland server, similar to the X server. It is not a random program snooping the screen, and under Wayland that is not possible. To get access to the screen, you have to use apis to explicitly ask for that access, and the user must approve the request.
Under X, any program can snoop the screen and do what the like with it.
By that logic, is the compositor working any different than a trojan? Is there really a difference?
The Wayland compositor is always capturing all your keyboard and mouse as well. No permissions asked. Pretty sus.
No, the compositor is the Wayland server, similar to the X server. It is not a random program snooping the screen, and under Wayland that is not possible. To get access to the screen, you have to use apis to explicitly ask for that access, and the user must approve the request. Under X, any program can snoop the screen and do what the like with it.