It happens in both Ubuntu 22.04 and Manjaro (Gnome). If I install XRDP on it and connect to it via XRDP, for some apps the sudo password dialogue is working, and for some other apps, it does not work. Why is it so, and is there any way to fix it?

An example of not working app is Nautilus (Files). On Manjaro, the `nautilus-admin` extension is installed by default, and on Ubuntu, you can install it from the official repository. Now, if you right click a directory in Files and choose "Open as Administrator", it fails in XRDP, because it does not show the sudo password dialogue as it does when doing it locally.