Skip to content
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

Alt-space does not open the system menu on Windows #2406

Closed
sshock opened this issue Aug 1, 2022 · 3 comments · Fixed by #2445
Closed

Alt-space does not open the system menu on Windows #2406

sshock opened this issue Aug 1, 2022 · 3 comments · Fixed by #2445
Labels
B - bug Dang, that shouldn't have happened DS - windows

Comments

@sshock
Copy link
Contributor

sshock commented Aug 1, 2022

On Windows I am unable to open the system menu with the keyboard shortcut alt+space.

Steps to reproduce:

  • cargo run --example window
  • Hold down Alt and hit Spacebar.

Expected results:

  • It should show the system menu.

Actual results:

  • It does not show the system menu.

You can open the system menu by clicking on the window's icon in the top-left corner, but not by pressing alt+space. Being able to trigger it with alt+space is expected behavior for all well-behaved apps on Windows.

@ajtribick
Copy link
Contributor

Looks like this is related to handling of the WM_SYSKEYDOWN and WM_SYSCHAR messages. According to Microsoft's documentation, these should be passed to DefWindowProc, as far as I can see this never happens for WM_SYSCHAR and only happens for WM_SYSKEYDOWN in the case of ALT+F4.

If I remove the handling of WM_SYSKEYDOWN and WM_SYSCHAR entirely by removing these cases from the match in public_window_callback_inner, the ALT+Space combination works again, but I believe this would also prevent the application from receiving ALT+{any key}.

@sshock
Copy link
Contributor Author

sshock commented Aug 27, 2022

Interesting. If it's helpful and you want to send me a patch I could maybe help test whether or not it prevents the app from receiving any other alt combinations (I could test with alacritty).

@sshock
Copy link
Contributor Author

sshock commented Aug 31, 2022

Thanks! Looking forward to seeing this in downstream project alacritty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened DS - windows
Development

Successfully merging a pull request may close this issue.

3 participants