Skip to content

Properly implement window activation on X11

Nicolas Fella requested to merge work/nico/raisex11 into master

The current code is subtly broken in two ways:

  1. KStartupInfo::startupId() will return an empty startup id. This is because QApplication reads the relevant environment variable and clears it afterwards. To access it we need to use QX11Info::nextStartupId

  2. We are reading KStartupInfo::startupId() from the wrong instance. We need to read the id from the second instance and pass it via DBus to the first instance, like we do on Wayland with the activation token

The user-facing impact of this is minimal since KStartupInfo::setNewStartupId internally calls KWindowSystem::forceActiveWindow.

However, this code is more technically correct and may play nicer with focus stealing prevention

Merge request reports

Loading