Skip to content

Fix: Suppress Asterisk sound on Alt+Enter by handling WM_MENUCHAR - #18815

Merged
yair100 merged 3 commits into
files-community:mainfrom
EvuhLi:alt-enter-asterisk-sound
Aug 17, 2026
Merged

Fix: Suppress Asterisk sound on Alt+Enter by handling WM_MENUCHAR #18815
yair100 merged 3 commits into
files-community:mainfrom
EvuhLi:alt-enter-asterisk-sound

Conversation

@EvuhLi

@EvuhLi EvuhLi commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Root cause: Alt+Enter (Properties) triggers WM_MENUCHAR inside DefWindowProc's menu-tracking code since there's no matching mnemonic, which plays the system Asterisk sound.

Fix: WM_MENUCHAR is sent directly to the window proc rather than posted through the thread's message queue, so it's handled in the existing WindowManager subclass callback alongside WM_WINDOWPOSCHANGING, returning MNC_CLOSE to suppress the beep.

Resolved / Related Issues

To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

Steps used to test these changes

Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

  1. Tested in FIles, pressed Alt+Enter and Properties dialog opened correctly, no Asterisk sound played
  2. Verified the sibling WM_WINDOWPOSCHANGING branch in the handler still fires correctly
  3. Verified other Alt + Action items properly worked

…les-community#18472)

Alt+Enter (Properties) triggers WM_MENUCHAR inside DefWindowProc's
menu-tracking code since there's no matching mnemonic, which plays the
system Asterisk sound. WM_MENUCHAR is sent directly to the window proc
rather than posted through the thread's message queue, so it's handled
in the existing WindowManager subclass callback alongside
WM_WINDOWPOSCHANGING, returning MNC_CLOSE to suppress the beep.
@CLAassistant

CLAassistant commented Aug 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@yair100
yair100 requested a review from 0x5bfa August 13, 2026 16:24
@yair100 yair100 added the ready for review Pull requests that are ready for review label Aug 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 661a0b6b78

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Files.App/Helpers/Win32/Win32PInvoke.Consts.cs Outdated
Comment thread src/Files.App/MainWindow.xaml.cs Outdated
@yair100

yair100 commented Aug 13, 2026

Copy link
Copy Markdown
Member

I'm having trouble reproducing the issue so I can't confirm if this resolves it. @Josh65-2201 can you reproduce the issue on your end?

@yair100
yair100 requested a review from Josh65-2201 August 13, 2026 20:26
Josh65-2201
Josh65-2201 previously approved these changes Aug 13, 2026

@Josh65-2201 Josh65-2201 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can. This has fixed it

- Generate MENUCHARRESULT via CsWin32 instead of hand-typed constants
- Remove WM_MENUCHAR and MNC_CLOSE from Win32PInvoke.Consts.cs
- Limit WM_MENUCHAR suppression to Enter key only to avoid closing menus on unmatched keystrokes
@yair100
yair100 requested a review from Josh65-2201 August 17, 2026 14:19
@yair100 yair100 added ready to merge Pull requests that are approved and ready to merge and removed ready for review Pull requests that are ready for review labels Aug 17, 2026
@yair100
yair100 merged commit e98a2d2 into files-community:main Aug 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Pull requests that are approved and ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Windows Asterisk sound plays when pressing alt+enter shortcut to open file properties

4 participants