Currently, gui-libs/wlroots comes with various wayland protocols implemented, one of which is a protocol that implements taking screenshots by allowing any process view the content of every other window. KDE and GNOME implement their own wayland backend, which contain some form of restrictions to forbid arbitrary apps from viewing other windows. However, wlroots doesn't offer any options to decide which process uses which privileged protocol (for whatever valid reasons they may have). This makes introducing USE flags to toggle such privileged protocols extremely useful, so that users who do not wish to use them have a convenient way to disable them during the build time, without having to use SELinux, Apparmor, Flatpak, etc. I suggest to add at least a USE flag "screenshot" (or whatever name more accurately representing the concerned protocol), to decide whether apps in wlroots should be able to view other apps' windows (screenshots).
I'm not aware of a way to do this natively yet. This seems like a good idea for a feature request. See https://gitlab.freedesktop.org/wlroots/wlroots/-/issues to make that request. Thanks.