nsxivee908ca
Simplify cursor reset in image mode
No need to give cursor name. reset_cursor() is now the only place to decide what cursor to fall back to.
+3 −3
2 files changed
- M commands.c +1 −1
- M main.c +2 −2
| @@ -351,8 +351,8 @@ bool ci_drag(arg_t _) | |||
| 351 | 351 | x = e.xmotion.x; | |
| 352 | 352 | y = e.xmotion.y; | |
| 353 | 353 | } | |
| 354 | − | win_set_cursor(&win, CURSOR_ARROW); | |
| 355 | 354 | set_timeout(reset_cursor, TO_CURSOR_HIDE, true); | |
| 355 | + | reset_cursor(); | |
| 356 | 356 | ||
| 357 | 357 | return true; | |
| 358 | 358 | } | |
| @@ -622,8 +622,8 @@ void on_buttonpress(XButtonEvent *bev) | |||
| 622 | 622 | static Time firstclick; | |
| 623 | 623 | ||
| 624 | 624 | if (mode == MODE_IMAGE) { | |
| 625 | − | win_set_cursor(&win, CURSOR_ARROW); | |
| 626 | 625 | set_timeout(reset_cursor, TO_CURSOR_HIDE, true); | |
| 626 | + | reset_cursor(); | |
| 627 | 627 | ||
| 628 | 628 | for (i = 0; i < ARRLEN(buttons); i++) { | |
| 629 | 629 | if (buttons[i].button == bev->button && | |
| @@ -783,8 +783,8 @@ void run(void) | |||
| 783 | 783 | break; | |
| 784 | 784 | case MotionNotify: | |
| 785 | 785 | if (mode == MODE_IMAGE) { | |
| 786 | − | win_set_cursor(&win, CURSOR_ARROW); | |
| 787 | 786 | set_timeout(reset_cursor, TO_CURSOR_HIDE, true); | |
| 787 | + | reset_cursor(); | |
| 788 | 788 | } | |
| 789 | 789 | break; | |
| 790 | 790 | } | |