Page MenuHome GnuPG

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

Description

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.

Investigation

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.
(Ref: https://forum.qt.io/topic/90639/comparing-qt-widgets-app-under-gnome-wayland-using-platform-wayland-egl-to-xcb/8)

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

Details

Version
1.1.1

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