Process WM_SYSCOMMAND to forbid screen savers in fullscreen mode (#1065)

* Process WM_SYSCOMMAND to forbid screen savers in fullscreen mode

Fixes #1047

* Update CHANGELOG.md and documentation to reflect changes from issue #1065

* Updated documentation of window.Window.set_fullscreen to match the documentation of window.WindowBuilder.with_fullscreen.
This commit is contained in:
dam4rus 2019-07-29 11:18:23 +02:00 committed by Hal Gentz
parent f4e9bf51db
commit e5ba79db04
3 changed files with 17 additions and 0 deletions

View file

@ -1020,6 +1020,17 @@ unsafe extern "system" fn public_window_callback<T>(
// other unwanted default hotkeys as well.
winuser::WM_SYSCHAR => 0,
winuser::WM_SYSCOMMAND => {
if wparam == winuser::SC_SCREENSAVE {
let window_state = subclass_input.window_state.lock();
if window_state.fullscreen.is_some() {
return 0;
}
}
winuser::DefWindowProcW(window, msg, wparam, lparam)
}
winuser::WM_MOUSEMOVE => {
use crate::event::WindowEvent::{CursorEntered, CursorMoved};
let mouse_was_outside_window = {