I can reproduce this on Ubuntu 24.04.4 in a GNOME/X11 session.

Environment:

- GNOME Shell 46.0
- Mutter `46.2-1ubuntu0.24.04.16`
- Firefox Snap 154.0
- Dual-monitor NVIDIA setup
- Focus settings are the defaults: click-to-focus, `focus-new-windows=smart`, 
and `raise-on-click=true`

I have reproduced it through at least two different applications:

1. Opening an external link from ZapZap 7.4.2 (a Flatpak WhatsApp client) in an 
already-running Firefox.
2. Opening a link from Ghostty in an already-running Firefox.

In both cases Firefox is raised and appears focused, but keyboard input
remains directed to the source application. When Ghostty is the source,
arbitrary typing and arrow keys continue going to the terminal, and
Ctrl+C sends SIGINT rather than being handled by Firefox... which you
can imagine is especially annoying. Clicking inside Firefox does not
reliably correct the focus. Cycling away and back with Alt+Tab fixes it.

I also found direct evidence of a future X11 user timestamp. After
recovering focus, the approximate current X-server time was:

```
739070140
```

But one Desktop Icons NG/GJS window had:

```
_NET_WM_USER_TIME_WINDOW = 0x38008ab
_NET_WM_USER_TIME = 921190944
```

That timestamp was approximately `182120804 ms` (50.59 hours) in the
future. DING is package version `46+really47.0.9-1ubuntu5`.

This appears consistent with the future-timestamp explanation: Mutter
raises the requested window and considers it active, while Xorg rejects
the corresponding `SetInputFocus` request, leaving keyboard input with
the previously focused application.

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to mutter in Ubuntu.
https://bugs.launchpad.net/bugs/2107678

Title:
  Wrong keyboard focus after switching window in Xorg

To manage notifications about this bug go to:
https://bugs.launchpad.net/mutter/+bug/2107678/+subscriptions


-- 
desktop-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to