hard-code which targets have drag_resize support
This replaces the previous check which appeared to rely on the assumption that initiating a drag_resize without a left mouse press wouldn't actually start a resize (this assumption is false on Windows).
This commit is contained in:
parent
c2ad04a4da
commit
c984005e9b
1 changed files with 22 additions and 1 deletions
|
|
@ -12,7 +12,7 @@ pub fn event_func(
|
||||||
) -> bool,
|
) -> bool,
|
||||||
>,
|
>,
|
||||||
> {
|
> {
|
||||||
if window.drag_resize_window(ResizeDirection::East).is_ok() {
|
if drag_resize_supported() {
|
||||||
// Keep track of cursor when it is within a resizeable border.
|
// Keep track of cursor when it is within a resizeable border.
|
||||||
let mut cursor_prev_resize_direction = None;
|
let mut cursor_prev_resize_direction = None;
|
||||||
|
|
||||||
|
|
@ -62,6 +62,27 @@ pub fn event_func(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Test if the current target should be assumed to have winit drag_resize support
|
||||||
|
const fn drag_resize_supported() -> bool {
|
||||||
|
#[cfg(all(
|
||||||
|
unix,
|
||||||
|
not(target_vendor = "apple"),
|
||||||
|
not(target_os = "android"),
|
||||||
|
not(target_os = "emscripten")
|
||||||
|
))]
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(unreachable_code)]
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
/// Get the cursor icon that corresponds to the resize direction.
|
/// Get the cursor icon that corresponds to the resize direction.
|
||||||
fn resize_direction_cursor_icon(
|
fn resize_direction_cursor_icon(
|
||||||
resize_direction: Option<ResizeDirection>,
|
resize_direction: Option<ResizeDirection>,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue