SDL.qpg.in
author Sam Lantinga <slouken@libsdl.org>
Thu, 17 Apr 2014 22:36:14 -0700
branchSDL-1.2
changeset 8716 0aade9c0203f
parent 6130 987c365cc7bf
permissions -rw-r--r--
Fixed bug 2325 - SDL_EnableUNICODE sometimes drops keyboard events completely

Rafał Mużyło

The most annoying part of this bug is that though I've found it in two separate apps, I don't have a trivial testcase for it.

The problem seems to be a condition race, as it's triggered quite randomly (therefore it will be hard to tell whether it really gets fixed, if a probable fix is found).

While it's specific to SDL 1.2, it seems quite similar to the problem described and fixed in http://forums.libsdl.org/viewtopic.php?p=40503.

Now, I should start describing the problem.

A game uses Escape to open menu (the exact key might not be important). Upon opening, it calls SDL_EnableUNICODE(1). Upon closing it calls SDL_EnableUNICODE(0).

I have an IME running.

Game uses SDL_PollEvent to get the events.

If Escape is pressed repeatedly, menu is opened and closed, till it eventually freezes in open state.
"freezes" in this context means "app itself still runs, but no keyboard events are getting delivered (though - for example - mouse events still are)". "getting delivered" should mean "SDL_PollEvent is not receiving any".
If it matters, the last delivered keyboard event is a keypress, the release never arrives.

It seems (no guarantees, due to random nature of the freeze) that unsetting XMODIFIERS (which - AFAIU - will disable IME as far as SDL is concerned) prevents the freeze, therefore the reference to that SDL2 thread.
     1 <QPG:Generation>
     2    <QPG:Options>
     3       <QPG:User unattended="yes" verbosity="0" listfiles="yes"/>
     4       <QPG:Defaults type="qnx_package"/>
     5       <QPG:Source></QPG:Source>
     6       <QPG:Release date="today" number="+"/>
     7       <QPG:Build></QPG:Build>
     8       <QPG:FileSorting strip="yes"/>
     9       <QPG:Package targets="standart"/>
    10       <QPG:Repository generate="yes"/>
    11       <QPG:FinalDir></QPG:FinalDir>
    12       <QPG:Cleanup></QPG:Cleanup>
    13    </QPG:Options>
    14 
    15    <QPG:Responsible>
    16       <QPG:Company>QNX.ORG.RU Community</QPG:Company>
    17       <QPG:Department></QPG:Department>
    18       <QPG:Group></QPG:Group>
    19       <QPG:Team>QNX.ORG.RU Team</QPG:Team>
    20       <QPG:Employee>Mike Gorchak</QPG:Employee>
    21       <QPG:EmailAddress>mike@malva.ua</QPG:EmailAddress>
    22    </QPG:Responsible>
    23 
    24    <QPG:Values>
    25       <QPG:Files>
    26          <QPG:Add file="./COPYING" install="LicenseUrl/" handling="repdata"/>
    27          <QPG:Add permissions="0755" file="./src/.libs/libSDL-@SDL_MAJOR_VERSION@.@SDL_MINOR_VERSION@.so.@LT_AGE@" install="/usr/lib/"/>
    28          <QPG:Add filetype="symlink" file="libSDL.so" install="/usr/lib/" linkto="libSDL-@SDL_MAJOR_VERSION@.@SDL_MINOR_VERSION@.so.@LT_AGE@"/>
    29          <QPG:Add permissions="0644" file="./src/.libs/libSDL.a" install="/usr/lib/"/>
    30          <QPG:Add permissions="0644" file="./src/.libs/libSDL.lai" install="/usr/lib/libSDL.la"/>
    31          <QPG:Add permissions="0644" file="./src/.libs/libSDLmain.a" install="/usr/lib/"/>
    32          <QPG:Add permissions="0644" file="./src/.libs/libSDLmain.lai" install="/usr/lib/libSDLmain.lai"/>
    33          <QPG:Add permissions="0644" file="./include/*.h" install="/usr/include/SDL/"/>
    34          <QPG:Add permissions="0755" file="./sdl-config" install="/usr/bin/"/>
    35          <QPG:Add permissions="0644" file="./BUGS" install="/usr/share/doc/SDL12/"/>
    36          <QPG:Add permissions="0644" file="./COPYING" install="/usr/share/doc/SDL12/"/>
    37          <QPG:Add permissions="0644" file="./CREDITS" install="/usr/share/doc/SDL12/"/>
    38          <QPG:Add permissions="0644" file="./INSTALL" install="/usr/share/doc/SDL12/"/>
    39          <QPG:Add permissions="0644" file="./README" install="/usr/share/doc/SDL12/"/>
    40          <QPG:Add permissions="0644" file="./README-SDL.txt" install="/usr/share/doc/SDL12/"/>
    41          <QPG:Add permissions="0644" file="./README.CVS" install="/usr/share/doc/SDL12/"/>
    42          <QPG:Add permissions="0644" file="./README.QNX" install="/usr/share/doc/SDL12/"/>
    43          <QPG:Add permissions="0644" file="./TODO" install="/usr/share/doc/SDL12/"/>
    44          <QPG:Add permissions="0644" file="./WhatsNew" install="/usr/share/doc/SDL12/"/>
    45          <QPG:Add permissions="0644" file="./docs.html" install="/usr/share/doc/SDL12/Changes.html"/>
    46          <QPG:Add permissions="0644" file="./docs/index.html" install="/usr/share/doc/SDL12/docs/"/>
    47          <QPG:Add permissions="0644" file="./docs/html/*.html" install="/usr/share/doc/SDL12/docs/html/"/>
    48          <QPG:Add permissions="0644" file="./docs/man3/*.3" install="/usr/share/man/man3/"/>
    49          <QPG:Add permissions="0644" file="./sdl.m4" install="/usr/share/aclocal/"/>
    50       </QPG:Files>
    51       <QPG:PackageFilter>
    52          <QPM:PackageManifest>
    53 
    54             <QPM:PackageDescription>
    55                <QPM:PackageType>Library</QPM:PackageType>
    56                <QPM:PackageName>SDL</QPM:PackageName>
    57                <QPM:PackageReleaseNumber>1</QPM:PackageReleaseNumber>
    58                <QPM:PackageRepository>http://qnx.org.ru/repository</QPM:PackageRepository>
    59                <QPM:FileVersion>2.6</QPM:FileVersion>
    60             </QPM:PackageDescription>
    61 
    62             <QPM:ProductDescription>
    63                <QPM:ProductName>Simple DirectMedia Layer (SDL)</QPM:ProductName>
    64                <QPM:ProductIdentifier>SDL</QPM:ProductIdentifier>
    65                <QPM:ProductEmail>slouken@libsdl.org</QPM:ProductEmail>
    66                <QPM:VendorName>Public</QPM:VendorName>
    67                <QPM:VendorInstallName>public</QPM:VendorInstallName>
    68                <QPM:VendorURL>http://www.libsdl.org</QPM:VendorURL>
    69                <QPM:VendorEmbedURL/>
    70                <QPM:VendorEmail>slouken@libsdl.org</QPM:VendorEmail>
    71                <QPM:AuthorName>Sam Lantinga</QPM:AuthorName>
    72                <QPM:AuthorURL>http://www.libsdl.org</QPM:AuthorURL>
    73                <QPM:AuthorEmbedURL/>
    74                <QPM:AuthorEmail>slouken@libsdl.org</QPM:AuthorEmail>
    75                <QPM:ProductIconSmall/>
    76                <QPM:ProductIconLarge/>
    77                <QPM:ProductDescriptionShort>This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</QPM:ProductDescriptionShort>
    78                <QPM:ProductDescriptionLong>This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms. This is the libraries, include files and other resources you can use to develop and run SDL applications.</QPM:ProductDescriptionLong>
    79                <QPM:ProductDescriptionURL>http://www.libsdl.org</QPM:ProductDescriptionURL>
    80                <QPM:ProductDescriptionEmbedURL/>
    81             </QPM:ProductDescription>
    82 
    83             <QPM:ReleaseDescription>
    84                <QPM:ReleaseVersion>@VERSION@</QPM:ReleaseVersion>
    85                <QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
    86                <QPM:ReleaseStability>Stable</QPM:ReleaseStability>
    87                <QPM:ReleaseNoteMinor/>
    88                <QPM:ReleaseNoteMajor/>
    89                <QPM:ReleaseBuild>1</QPM:ReleaseBuild>
    90                <QPM:CountryExclude/>
    91                <QPM:ReleaseCopyright>GNU Lesser General Public License</QPM:ReleaseCopyright>
    92             </QPM:ReleaseDescription>
    93 
    94             <QPM:ContentDescription>
    95                <QPM:ContentTopic xmlmultiple="true">Software Development/Libraries and Extensions/C Libraries</QPM:ContentTopic>
    96                <QPM:ContentKeyword>SDL,audio,graphics,demos,games,emulators,direct,media,layer</QPM:ContentKeyword>
    97                <QPM:TargetOS>qnx6</QPM:TargetOS>
    98                <QPM:HostOS>none</QPM:HostOS>
    99                <QPM:DisplayEnvironment xmlmultiple="true">Photon</QPM:DisplayEnvironment>
   100                <QPM:DisplayEnvironment xmlmultiple="true">Console</QPM:DisplayEnvironment>
   101                <QPM:TargetAudience xmlmultiple="true">Developer</QPM:TargetAudience>
   102                <QPM:TargetAudience xmlmultiple="true">User</QPM:TargetAudience>
   103             </QPM:ContentDescription>
   104             <QPM:LicenseUrl>repdata://LicenseUrl/COPYING</QPM:LicenseUrl>
   105          </QPM:PackageManifest>
   106       </QPG:PackageFilter>
   107 
   108       <QPG:PackageFilter proc="none" target="none">
   109          <QPM:PackageManifest>
   110             <QPM:ProductInstallationDependencies>
   111                <QPM:ProductRequirements></QPM:ProductRequirements>
   112             </QPM:ProductInstallationDependencies>
   113          </QPM:PackageManifest>
   114       </QPG:PackageFilter>
   115 
   116       <QPG:PackageFilter proc="x86" target="none">
   117          <QPM:PackageManifest>
   118             <QPM:ProductInstallationDependencies>
   119                <QPM:ProductRequirements></QPM:ProductRequirements>
   120             </QPM:ProductInstallationDependencies>
   121          </QPM:PackageManifest>
   122       </QPG:PackageFilter>
   123 
   124       <QPG:PackageFilter proc="none" target="x86">
   125          <QPM:PackageManifest>
   126             <QPM:ProductInstallationDependencies>
   127                <QPM:ProductRequirements></QPM:ProductRequirements>
   128             </QPM:ProductInstallationDependencies>
   129          </QPM:PackageManifest>
   130       </QPG:PackageFilter>
   131 
   132       <QPG:PackageFilter proc="x86" target="x86">
   133          <QPM:PackageManifest>
   134             <QPM:ProductInstallationDependencies>
   135                <QPM:ProductRequirements></QPM:ProductRequirements>
   136             </QPM:ProductInstallationDependencies>
   137          </QPM:PackageManifest>
   138       </QPG:PackageFilter>
   139 
   140    </QPG:Values>
   141 </QPG:Generation>