We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2780

Summary: ALT-F4 handling code in WM_KEYUP instead of WM_KEYDOWN
Product: SDL Reporter: Matt Eckert <me>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: 2.0.3Keywords: target-2.0.4, triage-2.0.4
Hardware: x86_64   
OS: Windows (All)   
Attachments: Move ALT-F4 code to WM_KEYDOWN

Description Matt Eckert 2014-11-11 11:54:24 UTC
Created attachment 1930 [details]
Move ALT-F4 code to WM_KEYDOWN

The code for detecting the special ALT-F4 combination on Windows platforms runs in the WM_KEYUP case. This means that sometimes seemingly good ALT-F4 presses will be ignored, depending on the order the keys are released. For example:

1. Hold ALT
2. Hold F4
3. Release ALT
4. Release F4
5. Window stays open

The default behavior in other Windows applications including explorer.exe is to close as soon as F4 goes down if ALT is held, so I have included a patch to move the code to the WM_KEYDOWN event.
Comment 1 Ryan C. Gordon 2015-02-19 06:32:15 UTC
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry
if you got a lot of email from this. This is to help me sort through some bugs
in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4,
though!
Comment 2 Ryan C. Gordon 2015-04-07 04:57:58 UTC
(sorry if you get a lot of copies of this email, I'm marking several bugs at once)

Marking bugs for the (mostly) final 2.0.4 TODO list. This means we're hoping to resolve this bug before 2.0.4 ships if possible. In a perfect world, the open bug count with the target-2.0.4 keyword is zero when we ship.

(Note that closing a bug report as WONTFIX, INVALID or WORKSFORME might still happen.)

--ryan.
Comment 3 Ryan C. Gordon 2015-05-27 00:40:52 UTC
This patch is now https://hg.libsdl.org/SDL/rev/425c1100b496, thanks!

--ryan.