-
Notifications
You must be signed in to change notification settings - Fork 67
[GEN][ZH] Fix left alt freezing game in window mode #837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
GeneralsMD/Code/Main/WinMain.cpp
Outdated
@@ -373,6 +373,10 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT message, | |||
case SC_SIZE: | |||
case SC_MAXIMIZE: | |||
case SC_KEYMENU: | |||
// TheSuperHackers @bugfix Mauller 10/05/2025 Handle left ALT when in windowed mode to prevent game freezing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uses tabs incorrectly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you mean? As in the alignment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the way it should be fixed is like so:
switch( wParam )
{
case SC_MOVE:
case SC_SIZE:
case SC_MAXIMIZE:
case SC_MONITORPOWER:
if( FALSE == ApplicationIsWindowed )
return 1;
break;
case SC_KEYMENU:
return 1;
}
d83b11a
to
0dc277c
Compare
Did something similar to this but i stuck the SC_KEYMENU option first in the switch. |
This PR prevents the game from freezing when the left ALT key is pressed.
The underlying issue is due to the games window process not acknowledging the
WM_SYSCOMMAND SC_KEYMENU
message.Due to this, the message is then processed by the default window process which then will try to open the windows context menu which does not exist in this instance but causes the message loop to freeze.
This may also help prevent some mismatches that could be caused by a game freezing for too long when someone is playing in window mode.