elementary / elementary/gala

Regression: Rofi fails to grab keyboard focus when launched from a focused Flatpak app

Open
#2,577 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vala
Stars
302
Forks
83
Avg merge
1d 1h
Merged PRs (30d)
7

Description

### What Happened?

After a system update on **[Aquí pones la fecha de tu actualización]**, the window focus behavior has changed. When Rofi is launched via a keyboard shortcut, it fails to gain keyboard focus if a Flatpak application is the currently active window. Rofi's UI appears, but any keyboard input is sent to the underlying Flatpak app instead.

This issue does not occur when Rofi is launched from a native (`.deb`) application like the system's Terminal, where it works correctly. A functional workaround is to add a small delay before the execution (`sh -c "sleep 0.1 && rofi -show drun"`), which suggests this is a new timing or race condition issue introduced by the update.

### Steps to Reproduce

1. Open any Flatpak application (e.g., a web browser, Calculator, etc.).
2. Ensure the Flatpak application window is the active, focused window.
3. Use the keyboard shortcut to launch Rofi (e.g., with the command `rofi -show drun`).
4. Observe that Rofi's window appears on screen.
5. Attempt to type into Rofi's prompt.
6. Notice that the text input is incorrectly captured by the Flatpak application in the background.

### Expected Behavior

Rofi should launch and immediately be ready to accept keyboard input, regardless of which application was previously focused.

### Host OS

elementary OS 8; Kernel: 6.14.0-33-generic

### Image Version

OS 8 stable

### Hardware Platform

64-bit AMD/Intel (x86)

### Log Output

```shell
UPGRADE PACKAGES
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
2025-10-13 10:48:17
CMD: Commandline: apt upgrade -y
-> Install: libxnvctrl0:amd64 (510.47.03-0ubuntu4, automatic), io.elementary.monitor:amd64 (8.0.0+r1271+pkg851~ubuntu8.1, automatic), linux-image-6.14.0-33-generic:amd64 (6.14.0-33.33~24.04.1, automatic), linux-headers-6.14.0-33-generic:amd64 (6.14.0-33.33~24.04.1, automatic), linux-hwe-6.14-headers-6.14.0-33:amd64 (6.14.0-33.33~24.04.1, automatic), linux-modules-6.14.0-33-generic:amd64 (6.14.0-33.33~24.04.1, automatic), io.elementary.maps:amd64 (8.1.0+pkg5~ubuntu8.1, automatic), liblivechart2:amd64 (2.0.0+r310+pkg4~ubuntu8.1, automatic), linux-modules-extra-6.14.0-33-generic:amd64 (6.14.0-33.33~24.04.1, automatic)
-> Upgrade: linux-headers-generic-hwe-24.04:amd64 (6.14.0-32.32~24.04.1, 6.14.0-33.33~24.04.1), elementary-minimal:amd64 (1.552+r624~ubuntu8.1, 1.557+r629~ubuntu8.1), tcpdump:amd64 (4.99.4-3ubuntu4, 4.99.4-3ubuntu4.24.04.1), containerd.io:amd64 (1.7.27-1, 1.7.28-1~ubuntu.24.04~noble), docker-compose-plugin:amd64 (2.39.4-0~ubuntu.24.04~noble, 2.40.0-1~ubuntu.24.04~noble), udev:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), libvirt-daemon-config-nwfilter:amd64 (10.0.0-2ubuntu8.8, 10.0.0-2ubuntu8.9), docker-ce-cli:amd64 (5:28.4.0-1~ubuntu.24.04~noble, 5:28.5.1-1~ubuntu.24.04~noble), systemd-container:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), wpasupplicant:amd64 (2:2.10-21ubuntu0.2, 2:2.10-21ubuntu0.3), systemd-timesyncd:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), libvirt-daemon:amd64 (10.0.0-2ubuntu8.8, 10.0.0-2ubuntu8.9), network-manager-config-connectivity-ubuntu:amd64 (1.46.0-1ubuntu2.2, 1.46.0-1ubuntu2.3), libpam-systemd:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), libvirt-daemon-system-systemd:amd64 (10.0.0-2ubuntu8.8, 10.0.0-2ubuntu8.9), libpoppler-cpp0t64:amd64 (24.02.0-1ubuntu9.6, 24.02.0-1ubuntu9.7), libgs10-common:amd64 (10.02.1~dfsg1-0ubuntu7.7, 10.02.1~dfsg1-0ubuntu7.8), firmware-sof-signed:amd64 (2023.12.1-1ubuntu1.9, 2023.12.1-1ubuntu1.10), libjavascriptcoregtk-4.1-0:amd64 (2.48.5-0ubuntu0.24.04.1, 2.48.7-0ubuntu0.24.04.2), libtiff6:amd64 (4.5.1+git230720-4ubuntu2.3, 4.5.1+git230720-4ubuntu2.4), libtiff6:i386 (4.5.1+git230720-4ubuntu2.3, 4.5.1+git230720-4ubuntu2.4), libgs10:amd64 (10.02.1~dfsg1-0ubuntu7.7, 10.02.1~dfsg1-0ubuntu7.8), io.elementary.greeter:amd64 (8.0.1+r1694+elementary+pkg102~ubuntu24.04.1, 8.1.0+r1774+elementary+pkg103~ubuntu8.1), libsystemd0:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), libsystemd0:i386 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), libnss-systemd:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), systemd:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), libudev1:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), libudev1:i386 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), poppler-utils:amd64 (24.02.0-1ubuntu9.6, 24.02.0-1ubuntu9.7), docker-buildx-plugin:amd64 (0.28.0-0~ubuntu.24.04~noble, 0.29.1-1~ubuntu.24.04~noble), libvirt0:amd64 (10.0.0-2ubuntu8.8, 10.0.0-2ubuntu8.9), docker-ce:amd64 (5:28.4.0-1~ubuntu.24.04~noble, 5:28.5.1-1~ubuntu.24.04~noble), systemd-dev:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), steam-libs-i386:i386 (1:1.0.0.84, 1:1.0.0.85), ghostscript:amd64 (10.02.1~dfsg1-0ubuntu7.7, 10.02.1~dfsg1-0ubuntu7.8), libnss-mymachines:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), libvirt-daemon-driver-qemu:amd64 (10.0.0-2ubuntu8.8, 10.0.0-2ubuntu8.9), systemd-resolved:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), docker-ce-rootless-extras:amd64 (5:28.4.0-1~ubuntu.24.04~noble, 5:28.5.1-1~ubuntu.24.04~noble), elementary-artwork:amd64 (1.552+r624~ubuntu8.1, 1.557+r629~ubuntu8.1), libpoppler134:amd64 (24.02.0-1ubuntu9.6, 24.02.0-1ubuntu9.7), network-manager:amd64 (1.46.0-1ubuntu2.2, 1.46.0-1ubuntu2.3), pantheon-shell:amd64 (1.552+r624~ubuntu8.1, 1.557+r629~ubuntu8.1), libvirt-clients:amd64 (10.0.0-2ubuntu8.8, 10.0.0-2ubuntu8.9), systemd-coredump:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), snapd:amd64 (2.68.5+ubuntu24.04.1, 2.71+ubuntu24.04), libssl-dev:amd64 (3.0.13-0ubuntu3.5, 3.0.13-0ubuntu3.6), systemd-hwe-hwdb:amd64 (255.1.5, 255.1.6), megasync:amd64 (5.15.0-1.1, 5.16.0-1.1), libvirt-daemon-config-network:amd64 (10.0.0-2ubuntu8.8, 10.0.0-2ubuntu8.9), libvirt-l10n:amd64 (10.0.0-2ubuntu8.8, 10.0.0-2ubuntu8.9), libwebkit2gtk-4.1-0:amd64 (2.48.5-0ubuntu0.24.04.1, 2.48.7-0ubuntu0.24.04.2), linux-image-generic-hwe-24.04:amd64 (6.14.0-32.32~24.04.1, 6.14.0-33.33~24.04.1), libgranite7:amd64 (7.6.0+r2648+pkg139~ubuntu8.1, 7.7.0+r2845+pkg143~ubuntu8.1), elementary-desktop:amd64 (1.552+r624~ubuntu8.1, 1.557+r629~ubuntu8.1), libsystemd-shared:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), steam-launcher:amd64 (1:1.0.0.84, 1:1.0.0.85), elementary-standard:amd64 (1.552+r624~ubuntu8.1, 1.557+r629~ubuntu8.1), codium:amd64 (1.104.26450, 1.105.06808), libgranite-7-common:amd64 (7.6.0+r2648+pkg139~ubuntu8.1, 7.7.0+r2845+pkg143~ubuntu8.1), libssl3t64:amd64 (3.0.13-0ubuntu3.5, 3.0.13-0ubuntu3.6), systemd-sysv:amd64 (255.4-1ubuntu8.10, 255.4-1ubuntu8.11), wingpanel-indicator-sound:amd64 (8.0.1+r809+pkg32~ubuntu8.1, 8.0.2+r859+pkg33~ubuntu8.1), libvirt-daemon-system:amd64 (10.0.0-2ubuntu8.8, 10.0.0-2ubuntu8.9), libpoppler-glib8t64:amd64 (24.02.0-1ubuntu9.6, 24.02.0-1ubuntu9.7), libgs-common:amd64 (10.02.1~dfsg1-0ubuntu7.7, 10.02.1~dfsg1-0ubuntu7.8), wireplumber:amd64 (0.4.17-1ubuntu4, 0.4.17-1ubuntu4.1), pantheon:amd64 (1.552+r624~ubuntu8.1, 1.557+r629~ubuntu8.1), libnm0:amd64 (1.46.0-1ubuntu2.2, 1.46.0-1ubuntu2.3), libnm0:i386 (1.46.0-1ubuntu2.2, 1.46.0-1ubuntu2.3), openssl:amd64 (3.0.13-0ubuntu3.5, 3.0.13-0ubuntu3.6), steam-libs-amd64:amd64 (1:1.0.0.84, 1:1.0.0.85), libwireplumber-0.4-0:amd64 (0.4.17-1ubuntu4, 0.4.17-1ubuntu4.1), linux-libc-dev:amd64 (6.8.0-84.84, 6.8.0-85.85)

▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲
```

### Hardware Info

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.