mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11:00
On Windows, fix left mouse button release event not being sent after Window::drag_window
(#2564)
This commit is contained in:
parent
4ed4e918f3
commit
9f781bc422
|
@ -8,6 +8,7 @@ And please only add new entries to the top of this list, right below the `# Unre
|
||||||
|
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
- On Windows, fix left mouse button release event not being sent after `Window::drag_window`.
|
||||||
- On macOS, run most actions on the main thread, which is strictly more correct, but might make multithreaded applications block slightly more.
|
- On macOS, run most actions on the main thread, which is strictly more correct, but might make multithreaded applications block slightly more.
|
||||||
- On macOS, fix panic when getting current monitor without any monitor attached.
|
- On macOS, fix panic when getting current monitor without any monitor attached.
|
||||||
- On Windows and MacOS, add API to enable/disable window buttons (close, minimize, ...etc).
|
- On Windows and MacOS, add API to enable/disable window buttons (close, minimize, ...etc).
|
||||||
|
|
|
@ -1006,9 +1006,13 @@ unsafe fn public_window_callback_inner<T: 'static>(
|
||||||
}
|
}
|
||||||
|
|
||||||
WM_EXITSIZEMOVE => {
|
WM_EXITSIZEMOVE => {
|
||||||
userdata
|
let mut state = userdata.window_state_lock();
|
||||||
.window_state_lock()
|
if state.dragging {
|
||||||
.set_window_flags_in_place(|f| f.remove(WindowFlags::MARKER_IN_SIZE_MOVE));
|
state.dragging = false;
|
||||||
|
PostMessageW(window, WM_LBUTTONUP, 0, lparam);
|
||||||
|
}
|
||||||
|
|
||||||
|
state.set_window_flags_in_place(|f| f.remove(WindowFlags::MARKER_IN_SIZE_MOVE));
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -418,6 +418,9 @@ impl Window {
|
||||||
y: points.y as i16,
|
y: points.y as i16,
|
||||||
};
|
};
|
||||||
ReleaseCapture();
|
ReleaseCapture();
|
||||||
|
|
||||||
|
self.window_state_lock().dragging = true;
|
||||||
|
|
||||||
PostMessageW(
|
PostMessageW(
|
||||||
self.hwnd(),
|
self.hwnd(),
|
||||||
WM_NCLBUTTONDOWN,
|
WM_NCLBUTTONDOWN,
|
||||||
|
|
|
@ -52,6 +52,8 @@ pub(crate) struct WindowState {
|
||||||
pub is_active: bool,
|
pub is_active: bool,
|
||||||
pub is_focused: bool,
|
pub is_focused: bool,
|
||||||
|
|
||||||
|
pub dragging: bool,
|
||||||
|
|
||||||
pub skip_taskbar: bool,
|
pub skip_taskbar: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,6 +164,8 @@ impl WindowState {
|
||||||
is_active: false,
|
is_active: false,
|
||||||
is_focused: false,
|
is_focused: false,
|
||||||
|
|
||||||
|
dragging: false,
|
||||||
|
|
||||||
skip_taskbar: false,
|
skip_taskbar: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue