This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 590919

Summary: Grabs all keys irrespective of uses
Product: [Fedora] Fedora Reporter: Bastien Nocera <bnocera>
Component: SDLAssignee: Thomas Woerner <twoerner>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: iprikryl, peter.hutterer, ppisar, twoerner
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-27 12:15:32 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Bastien Nocera 2010-05-10 19:58:58 EDT
Applications using SDL will automatically grab the whole of the keyboard using XGrabKeyboard, even if some of the keys are of absolutely no use to it.

The code under src/video/x11 should allow for some of the key events to be passed to the desktop/root window.

Keys that would have been helpful in my case were brightness keys and volume keys.
Comment 1 Bastien Nocera 2010-05-10 20:00:20 EDT
Peter, any ideas how to achieve that?

The XGrabKeyboard is pretty hard-coded in SDL:
363 ↦       ↦       /* Now grab the keyboard */•
364 ↦       ↦       XGrabKeyboard(SDL_Display, WMwindow, True,•
365 ↦       ↦       ↦       ↦       GrabModeAsync, GrabModeAsync, CurrentTime);•
Comment 2 Thomas Woerner 2010-05-11 05:02:33 EDT
Bastien, SDL does not know which keys are used by the application, therefore if may and should not ignore keys.

Usually games have their own volume control. Media applications are handling media keys on their own and also brightness and volume. Think of xbmc for example. These are very good reasons not to break the current keyboard event behaviour.
Comment 3 Petr Pisar 2010-05-11 05:07:20 EDT
I do investigation in this matter few years ago and I found it's a feature.
Imagine how wild gamblers felt, if they pressed wrong key and desktop
environment interrupted their game :) In addition a lot of games utilize keys
that clash with desktop shortcuts.

I think the grab could be optional (driven by an environment variable like
sound back-end selection). However I can not see any way how to differentiate
keys to pass to SDL and keys to pass to other X clients without SDL application
cooperation.

I propose to keyword this report as Feature request and pass it to upstream.
Comment 4 Peter Hutterer 2010-05-13 02:26:20 EDT
(In reply to comment #1)
> Peter, any ideas how to achieve that?

not without grab priorities, which are an idea to have for XI2.1 but far from execution. sorry.

you could sort-of get around it by passively grabbing the keys on the devices directly instead of on the master devices (core devices), but that only works now because no-one else does so. It'd be an arms race and sooner or later the same situation would present itself again.
Comment 5 Bug Zapper 2011-06-02 10:13:30 EDT
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 Bug Zapper 2011-06-27 12:15:32 EDT
Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.