Skip to content

Commit

Permalink
Windows: Pass WM_SYSCHAR and WM_SYSKEYDOWN to DefWindowProc
Browse files Browse the repository at this point in the history
Allows the ALT+Space menu to work
  • Loading branch information
ajtribick committed Aug 27, 2022
1 parent e91ee81 commit 62399e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ And please only add new entries to the top of this list, right below the `# Unre
- On Wayland, `wayland-csd-adwaita` now uses `ab_glyph` instead of `crossfont` to render the title for decorations.
- On Wayland, a new `wayland-csd-adwaita-crossfont` feature was added to use `crossfont` instead of `ab_glyph` for decorations.
- On Wayland, if not otherwise specified use upstream automatic CSD theme selection.
- On Windows, fixed ALT+Space shortcut to open window menu.

# 0.27.2 (2022-8-12)

Expand Down
16 changes: 12 additions & 4 deletions src/platform_impl/windows/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,12 @@ unsafe fn public_window_callback_inner<T: 'static>(
});
}
}
0

if msg == WM_SYSCHAR {
DefWindowProcW(window, msg, wparam, lparam)
} else {
0
}
}

WM_IME_STARTCOMPOSITION => {
Expand Down Expand Up @@ -1463,9 +1468,7 @@ unsafe fn public_window_callback_inner<T: 'static>(

WM_KEYDOWN | WM_SYSKEYDOWN => {
use crate::event::{ElementState::Pressed, VirtualKeyCode};
if msg == WM_SYSKEYDOWN && wparam == VK_F4 as usize {
DefWindowProcW(window, msg, wparam, lparam)
} else {
if msg != WM_SYSKEYDOWN || wparam != VK_F4 as usize {
if let Some((scancode, vkey)) = process_key_params(wparam, lparam) {
update_modifiers(window, userdata);

Expand All @@ -1492,6 +1495,11 @@ unsafe fn public_window_callback_inner<T: 'static>(
});
}
}
}

if msg == WM_SYSKEYDOWN {
DefWindowProcW(window, msg, wparam, lparam)
} else {
0
}
}
Expand Down

0 comments on commit 62399e3

Please sign in to comment.