Detect UID of window

In this Dolphin (Debian 4:22.12.3-1) there is nothing like that. But Kate and Co. allow editing of root files until it comes to saving, then you should know the root password. Emacs, on the other hand, opens these files read-only, so it goes the other way.

The topic overlaps with How to run GUI app as superuser?