Fixed window dragging for main menu

This commit is contained in:
2025-05-30 21:20:33 -05:00
parent b31aefe896
commit 16fc8949b3
12 changed files with 307 additions and 14 deletions
+15 -1
View File
@@ -20,7 +20,7 @@ pub type Result<T> = std::result::Result<T, String>;
// Platform-agnostic interface for cursor handling
#[cfg(target_os = "windows")]
pub use self::windows::{set_cursor, restore_default_cursor, init};
pub use self::windows::{set_cursor, restore_default_cursor, restore_default_cursor_temporarily, init};
#[cfg(target_os = "macos")]
pub use self::macos::{set_cursor, restore_default_cursor, init};
@@ -52,6 +52,20 @@ pub fn restore_system_cursor() -> Result<()> {
restore_default_cursor()
}
// Cross-platform implementation for temporarily restoring default cursor
pub fn restore_system_cursor_temporarily() -> Result<()> {
println!("Temporarily restoring system cursor");
#[cfg(target_os = "windows")]
{
restore_default_cursor_temporarily()
}
#[cfg(not(target_os = "windows"))]
{
// For non-Windows platforms, just use the regular restore for now
restore_default_cursor()
}
}
// Default implementations for non-supported platforms
#[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "linux")))]
pub fn set_cursor(_path: &str) -> Result<()> {