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:
qwen.ai[bot]
2026-03-23 04:13:15 +00:00
parent c291177ec1
commit 4484af560c
4 changed files with 127 additions and 48 deletions
+17
View File
@@ -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(())
}