'Determine what process requested pinentry

Is there a way to figure out what process triggered pinentry prompt?

In other words, imagine the prompt pops up, and you have no idea why (what process, what action triggered it). How would you figure it out?

Another question is more general - what is signalling mechanism behind such dialogs (dbus? gpg unix socket? something else?).

P.S.

Unfortunately process tree does not help:

  ├─systemd,138622 --user
  │   ├─(sd-pam),138623
  │   ├─dbus-daemon,138647 --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
  │   ├─dconf-service,139188
  │   │   ├─{gdbus},139190
  │   │   └─{gmain},139189
  │   ├─gpg-agent,139317 --supervised
  │   │   ├─pinentry,139327 --display :0
  │   │   │   ├─{QDBusConnection},139349
  │   │   │   └─{QXcbEventQueue},139330


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source