[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:55 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245854

            Bug ID: 245854
           Summary: x11-servers/xorg-server: Do not send spurious
                    FocusOut+FocusIn events
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: x11 at FreeBSD.org
          Reporter: naddy at FreeBSD.org
             Flags: maintainer-feedback?(x11 at FreeBSD.org)
          Assignee: x11 at FreeBSD.org

Created attachment 213727
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=213727&action=edit
Patch for x11-servers/xorg-server

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/364d64981549544213e2bca8de6ff8a5b2b5a69e

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-x11 mailing list