maintainer-feedback requested: [Bug 245854] x11-servers/xorg-server: Do not send spurious FocusOut+FocusIn events

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Apr 23 15:20:54 UTC 2020


Bugzilla Automation <bugzilla at FreeBSD.org> has asked freebsd-x11 mailing list
<x11 at FreeBSD.org> for maintainer-feedback:
Bug 245854: x11-servers/xorg-server: Do not send spurious FocusOut+FocusIn
events
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245854



--- Description ---
I would like to commit the attached patch to x11-servers/xorg-server.

This is an upstream fix for a problem in xorg-server 1.20 that causes spurious
FocusIn+FocusOut events to be sent.
https://gitlab.freedesktop.org/xorg/xserver/-/commit/364d64981549544213e2bca8de
6ff8a5b2b5a69e

The problem is easily seen with games/burgerspace. If burgerspace is started in
fullscreen mode (burgerspace --full-screen), the game keeps getting paused
every few seconds. You don't need to start any gameplay, it already happens in
attract mode. Press P to continue and it soon pauses again. The game purposely
pauses when its window loses focus, i.e. it receives a FocusOut event. The bug
in xserver 1.20 spams the game with spurious events.

Here is the upstream description:

----
dix: do not send focus event when grab actually does not change

c67f2eac ("dix: always send focus event on grab change") made dix
always sent events when it's a NotifyGrab or NotifyUngrab, even if
from == to, because 'from' can just come from a previous XSetInputFocus
call.

However, when an application calls XGrabKeyboard several times on
the same window, we are now sending spurious FocusOut+FocusIn with
NotifyGrab, even if the grab does not actually change. This makes screen
readers for blind people spuriously emit activity events which disturb
screen reading workflow when e.g. switching between menus.

This commit avoids calling DoFocusEvents in that precise case, i.e. when
oldWin is a previous grab and the new grab is the same window.


More information about the freebsd-x11 mailing list