Skip to content

Commit 3e0330f

Browse files
fix(shell): do not send message if TPM_NONOTIFY
#108
1 parent 726ea2f commit 3e0330f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/shell/entry.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace mb_shell {
4545

4646
void main() {
4747
set_thread_locale_utf8();
48-
48+
4949
AllocConsole();
5050
freopen("CONOUT$", "w", stdout);
5151
freopen("CONOUT$", "w", stderr);
@@ -103,8 +103,8 @@ void main() {
103103
}
104104
}).detach();
105105

106-
NtUserTrackHook->install((void*)+[](HMENU hMenu, UINT uFlags, int x, int y,
107-
HWND hWnd, LPTPMPARAMS lptpm) {
106+
NtUserTrackHook->install((void *)+[](HMENU hMenu, UINT uFlags, int x, int y,
107+
HWND hWnd, LPTPMPARAMS lptpm) {
108108
if (GetPropW(hWnd, L"COwnerDrawPopupMenu_This") &&
109109
config::current->context_menu.ignore_owner_draw) {
110110
return NtUserTrackHook->call_trampoline<size_t>(hMenu, uFlags, x, y, hWnd,
@@ -120,7 +120,7 @@ void main() {
120120

121121
has_active_menu = false;
122122

123-
if (menu_render.selected_menu) {
123+
if (menu_render.selected_menu && !(uFlags & TPM_NONOTIFY)) {
124124
PostMessageW(hWnd, WM_COMMAND, *menu_render.selected_menu, 0);
125125
PostMessageW(hWnd, WM_NULL, 0, 0);
126126
}

0 commit comments

Comments
 (0)