@@ -354,30 +354,33 @@ impl TransferManager { |
| 354 | 354 | let screen_width = (screen_max_x - screen_min_x) as f64; |
| 355 | 355 | let screen_height = (screen_max_y - screen_min_y) as f64; |
| 356 | 356 | |
| 357 | + // Offset from edge to prevent immediate re-triggering of edge detection |
| 358 | + const EDGE_INSET: i32 = 30; |
| 359 | + |
| 357 | 360 | let cursor_pos = match payload.cursor_pos { |
| 358 | 361 | CursorEntryPos::EdgeRelative(rel) => { |
| 359 | 362 | // from_direction indicates which edge the cursor enters from |
| 360 | 363 | // e.g., from_direction=Left means cursor enters at our left edge |
| 361 | 364 | match from_direction { |
| 362 | 365 | Direction::Left => { |
| 363 | | - // Cursor enters from left edge |
| 366 | + // Cursor enters from left edge - position slightly inward |
| 364 | 367 | let y = screen_min_y + (rel * screen_height) as i32; |
| 365 | | - (screen_min_x, y) |
| 368 | + (screen_min_x + EDGE_INSET, y) |
| 366 | 369 | } |
| 367 | 370 | Direction::Right => { |
| 368 | | - // Cursor enters from right edge |
| 371 | + // Cursor enters from right edge - position slightly inward |
| 369 | 372 | let y = screen_min_y + (rel * screen_height) as i32; |
| 370 | | - (screen_max_x - 1, y) |
| 373 | + (screen_max_x - EDGE_INSET, y) |
| 371 | 374 | } |
| 372 | 375 | Direction::Up => { |
| 373 | | - // Cursor enters from top edge |
| 376 | + // Cursor enters from top edge - position slightly inward |
| 374 | 377 | let x = screen_min_x + (rel * screen_width) as i32; |
| 375 | | - (x, screen_min_y) |
| 378 | + (x, screen_min_y + EDGE_INSET) |
| 376 | 379 | } |
| 377 | 380 | Direction::Down => { |
| 378 | | - // Cursor enters from bottom edge |
| 381 | + // Cursor enters from bottom edge - position slightly inward |
| 379 | 382 | let x = screen_min_x + (rel * screen_width) as i32; |
| 380 | | - (x, screen_max_y - 1) |
| 383 | + (x, screen_max_y - EDGE_INSET) |
| 381 | 384 | } |
| 382 | 385 | } |
| 383 | 386 | } |