mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
On Windows, fix left mouse button release event not being sent after Window::drag_window (#2564)
This commit is contained in:
@@ -1006,9 +1006,13 @@ unsafe fn public_window_callback_inner<T: 'static>(
|
||||
}
|
||||
|
||||
WM_EXITSIZEMOVE => {
|
||||
userdata
|
||||
.window_state_lock()
|
||||
.set_window_flags_in_place(|f| f.remove(WindowFlags::MARKER_IN_SIZE_MOVE));
|
||||
let mut state = userdata.window_state_lock();
|
||||
if state.dragging {
|
||||
state.dragging = false;
|
||||
PostMessageW(window, WM_LBUTTONUP, 0, lparam);
|
||||
}
|
||||
|
||||
state.set_window_flags_in_place(|f| f.remove(WindowFlags::MARKER_IN_SIZE_MOVE));
|
||||
0
|
||||
}
|
||||
|
||||
|
||||
@@ -418,6 +418,9 @@ impl Window {
|
||||
y: points.y as i16,
|
||||
};
|
||||
ReleaseCapture();
|
||||
|
||||
self.window_state_lock().dragging = true;
|
||||
|
||||
PostMessageW(
|
||||
self.hwnd(),
|
||||
WM_NCLBUTTONDOWN,
|
||||
|
||||
@@ -52,6 +52,8 @@ pub(crate) struct WindowState {
|
||||
pub is_active: bool,
|
||||
pub is_focused: bool,
|
||||
|
||||
pub dragging: bool,
|
||||
|
||||
pub skip_taskbar: bool,
|
||||
}
|
||||
|
||||
@@ -162,6 +164,8 @@ impl WindowState {
|
||||
is_active: false,
|
||||
is_focused: false,
|
||||
|
||||
dragging: false,
|
||||
|
||||
skip_taskbar: false,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user