Pinentry-qt does not always become active foreground window (especially when requesting pin for authentication)
Open, NormalPublic

Description

The pinentry-qt dialog appears when a PIN is needed for SSH authentication. However, this does not grab input focus, and appears at the end of the ALT-TAB menu. While the grab option is set in gpg-agent.conf, it doesn't seem to have any effect.

Edit by @aheinecke:
This has been reported and noticed also in other circumstances. We have code in pinentry-qt that tries to pop up in the foreground. On Windows the operating system does not support this properly, so we use hacks. Those hacks do not always work and need more work. Strangely enough the way GTK-2 does it seems to work, but trying to copy that behavior for Qt did not work properly.

Details

Version
3.1.2
a_p3rson created this task.Sep 1 2018, 7:59 AM
aheinecke claimed this task.Sep 4 2018, 8:52 AM
aheinecke added a project: pinentry.
aheinecke triaged this task as Normal priority.
aheinecke added a subscriber: aheinecke.

By grabbing I guess you mean that the cursor / keyboard input is automatically focused on the input field? I also noticed that this sometimes does not work well.

Global grabbing (You can't switch input focus to another window while pinentry is open) is something we purposely do not do anymore.

cepxuo added a subscriber: cepxuo.Sep 17 2018, 7:12 PM

I confirm this bug!

By grabbing I mean that it's not possible to input elsewhere. Same as ssh-askpass does.

werner closed this task as Invalid.Sep 18 2018, 3:34 PM
werner added a subscriber: werner.

Andre explained that we don't do that anymore on purpose. Duck and read the discussion related to this if you are intereested. A related thing is that no-grab does not work on all platforms because it was designed for standard X but nowdays toolkits have their own ideas what is right and what is wrong.

I think the point of my request was originally missed. I will take a screen
capture of the pinentry workflow during authentication and signing tasks -
in my opinion, they should be the same. However, during signing, the window
gets display focus (Windows switches it to the active window), whereas
during authentication it does not (and has to be alt-tabbed/switched to for
pin entry).

aheinecke reopened this task as Open.Sep 19 2018, 9:04 AM

@a_p3rson : Yes. I agree that I think that cepxuo meant something differently then you.

For you it is the input / active window focus which I agree is flaky and does not work fully reliably. So ->Open.

For cepxuo it is the "you cannot input anywhere else" while the pinentry window is open. That is intentionally not done.

I'll update the task description / name a bit to make this more clear.

aheinecke renamed this task from Pinentry-qt does not grab focus when requesting pin for authentication to Pinentry-qt does not always become active foreground window (especially when requesting pin for authentication).Sep 19 2018, 9:06 AM
aheinecke updated the task description. (Show Details)