mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 19:04:23 +08:00
Fix desktop touch screen window dragging issue
Key features implemented: - Add window_start_dragging command to src-tauri/src/commands/window.rs for initiating window drag operations - Implement touch-based window dragging functionality in src/main.tsx with proper touch event handling and drag region detection - Add startDraggingWindow API method to src/preload/types.ts to expose the window dragging capability - Update .gitignore with comprehensive ignore patterns for various development environments and file types The changes introduce proper support for dragging application windows on desktop devices with touch screens, addressing the core issue while maintaining compatibility with existing mouse-based interactions. The touch event handling includes safeguards to prevent interference with normal UI element interactions.
This commit is contained in:
@@ -152,3 +152,20 @@ pub async fn window_set_resizable(
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn window_start_dragging(
|
||||
app: AppHandle,
|
||||
_state: tauri::State<'_, Arc<RwLock<AppState>>>,
|
||||
) -> Result<(), String> {
|
||||
#[cfg(not(desktop))]
|
||||
{
|
||||
let _ = app;
|
||||
}
|
||||
|
||||
#[cfg(desktop)]
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
window.start_dragging().map_err(|e| e.to_string())?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user