gtk: Unless SETTITLE is used show the pid in the titlebar.
authorWerner Koch <wk@gnupg.org>
Fri, 3 Feb 2017 16:16:43 +0000 (17:16 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 3 Feb 2017 16:16:43 +0000 (17:16 +0100)
* gtk+-2/pinentry-gtk-2.c (create_window): Display the pid as title.
--

This information could also be used to lookup the command line of the
process and show that in the titlebar.

Signed-off-by: Werner Koch <wk@gnupg.org>
gtk+-2/pinentry-gtk-2.c

index e37601f..79cecda 100644 (file)
@@ -631,6 +631,17 @@ create_window (pinentry_t ctx)
       msg = pinentry_utf8_validate (pinentry->title);
       gtk_window_set_title (GTK_WINDOW(win), msg);
     }
+  else if (pinentry->owner_pid)
+    {
+      char buf[100];
+      snprintf (buf, sizeof buf, "%s [%lu]",
+                pinentry->owner_host? pinentry->owner_host:"",
+                pinentry->owner_pid);
+      buf[sizeof buf - 1] = 0;
+      gtk_window_set_title (GTK_WINDOW(win), buf);
+    }
+
+
   if (pinentry->description)
     {
       msg = pinentry_utf8_validate (pinentry->description);