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 3275 - SDL 2.0.4 does not allow activating system menu via keyboard
Summary: SDL 2.0.4 does not allow activating system menu via keyboard
Status: WAITING
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.4
Hardware: All Windows (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-29 03:31 UTC by winterknight
Modified: 2017-08-14 08:43 UTC (History)
0 users

See Also:


Attachments
Patch allows users to activate the system menu via keyboard. (443 bytes, patch)
2016-02-29 03:31 UTC, winterknight
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description winterknight 2016-02-29 03:31:56 UTC
Created attachment 2386 [details]
Patch allows users to activate the system menu via keyboard.

When using programs linked against SDL 2.0.4, the system menu is not properly activated when pressing Alt-Space. I tracked this down to hg commit 9624. In this commit, the developer was working around Windows's extra noisy behavior, fixing bug #2669. He did this by gobbling up every WM_SYSCOMMAND message, including legitimate ones.

I've provided a patch that allows WM_SYSCOMMAND when the Alt-Space is pressed, so that the system menu can still be activated. There may be other Alt-* combinations that should be whitelisted too.
Comment 1 Sam Lantinga 2017-08-12 04:40:08 UTC
We may need to add a hint for this. Games which use ALT as control (e.g. show HUD state, etc.) may want to be able to use space for jumping at the same time. More desktop style applications may be able to want to get to the system menu.

What is your use case here?
Comment 2 winterknight 2017-08-14 08:43:44 UTC
The use case is just ordinary window management. Moving the window, resizing, maximizing, etc. I discovered this bug when I was using a Windows computer with a low resolution screen, and the SDL2 program I was looking at had a window that was too big. The title bar was beyond the top of the screen, so I couldn't reach it with the mouse. Then I found out Alt-Space did not work as expected, and I could not move or resize the window at all.

Adding a hint might be a good idea. Would the same hint also disable Alt-Tab? Maybe the game wants to use Tab for firing and F4 to change the HUD.

Right now Alt-Space works fine in Linux, and I assume Mac, since hg commit 9624 was Windows specific and not intended to disable anything other than Windows's excessive beeping. Introducing this bug to Windows was an accident.

If you do add a hint, please make the default be to allow window manipulation via Alt-*, because those controls work fine in nearly every program, including SDL programs before 2.0.4, and users expect it to work. Also, the similar hint that's been available since SDL 2.0.4, SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4, allows Alt-F4 to work by default.