Page MenuHome GnuPG

pinentry-qt dialog cannot be raised under Linux/Wayland
Closed, ResolvedPublic


Problem description

After updating pinentry to version 1.1.1, pinentry-qt's dialog is minimized by default.

In the past the dialog would be shown and focused when it is created.


After git bisecting, turns out the first bad commit is a421ae. Which relate to bug T4123.

By removing line setWindowState(Qt::WindowMinimized); (link) in PinEntryDialog's constructor, the dialog
is shown and focused as expected.

Moreover, there are some warnings printed to the console when running command GETPIN in the pinentry-qt binary.

qt.qpa.wayland: Wayland does not support QWindow::requestActivate()

Seems that the requestActivate function is called by QWidget::activateWindow.

After some searching, it turns out that wayland by design does not allow grabbing focus.

A possible fix would be not calling setWindowState(Qt::WindowMinimized) in wayland. But I am not
sure about how it affects other parts of the codebase. This issue is like a fix that created another issue.

System information

  • Distribution: Arch Linux
  • DE: KDE 5.21
  • QT version: 5.15.2



Event Timeline

Seems that it is not a coincidence that Wayland starts with a W like Windows. ;-)

We have all kind of special code in place to allow popping up a focused pinentry under WIndows. This does not affect only affect pinentry but also, gpg-agent, gpg, gpgme, and applications using gpgme.

werner triaged this task as Normal priority.Apr 6 2021, 9:56 AM