Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Replace current drag-resize support check with hard-coded support values #202

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion winit/src/application/drag_resize.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
use winit::window::{CursorIcon, ResizeDirection};

#[cfg(any(
all(
unix,
not(target_vendor = "apple"),
not(target_os = "android"),
not(target_os = "emscripten"),
),
target_os = "windows",
))]
const DRAG_RESIZE_SUPPORTED: bool = true;

#[cfg(not(any(
all(
unix,
not(target_vendor = "apple"),
not(target_os = "android"),
not(target_os = "emscripten"),
),
target_os = "windows",
)))]
const DRAG_RESIZE_SUPPORTED: bool = false;

/// If supported by winit, returns a closure that implements cursor resize support.
pub fn event_func(
window: &dyn winit::window::Window,
Expand All @@ -12,7 +34,7 @@ pub fn event_func(
) -> 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.
let mut cursor_prev_resize_direction = None;

Expand Down
Loading