win32: account for mouse wheel speed setting

Also adds a method to toggle this behavior during runtime.
This commit is contained in:
Tony
2025-08-23 20:38:56 +08:00
committed by GitHub
parent b13b39aa0b
commit 317d62fb93
5 changed files with 96 additions and 18 deletions

View File

@@ -344,6 +344,11 @@ impl Window {
}
}
#[inline]
pub fn set_use_system_scroll_speed(&self, should_use: bool) {
self.window_state_lock().use_system_wheel_speed = should_use;
}
fn set_icon(&self, mut new_icon: Icon, icon_type: IconType) {
if let Some(icon) = new_icon.cast_ref::<RgbaIcon>() {
let icon = match WinIcon::from_rgba(icon) {
@@ -1303,6 +1308,7 @@ impl InitData<'_> {
win.set_skip_taskbar(self.win_attributes.skip_taskbar);
win.set_window_icon(self.attributes.window_icon.clone());
win.set_taskbar_icon(self.win_attributes.taskbar_icon.clone());
win.set_use_system_scroll_speed(self.win_attributes.use_system_wheel_speed);
let attributes = self.attributes.clone();