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.
This commit is contained in:
Bert Münnich 2017-10-05 13:49:11 +02:00
parent d81442f55d
commit ee908ca0a1
2 changed files with 3 additions and 3 deletions

View file

@ -351,8 +351,8 @@ bool ci_drag(arg_t _)
x = e.xmotion.x; x = e.xmotion.x;
y = e.xmotion.y; y = e.xmotion.y;
} }
win_set_cursor(&win, CURSOR_ARROW);
set_timeout(reset_cursor, TO_CURSOR_HIDE, true); set_timeout(reset_cursor, TO_CURSOR_HIDE, true);
reset_cursor();
return true; return true;
} }

4
main.c
View file

@ -622,8 +622,8 @@ void on_buttonpress(XButtonEvent *bev)
static Time firstclick; static Time firstclick;
if (mode == MODE_IMAGE) { if (mode == MODE_IMAGE) {
win_set_cursor(&win, CURSOR_ARROW);
set_timeout(reset_cursor, TO_CURSOR_HIDE, true); set_timeout(reset_cursor, TO_CURSOR_HIDE, true);
reset_cursor();
for (i = 0; i < ARRLEN(buttons); i++) { for (i = 0; i < ARRLEN(buttons); i++) {
if (buttons[i].button == bev->button && if (buttons[i].button == bev->button &&
@ -783,8 +783,8 @@ void run(void)
break; break;
case MotionNotify: case MotionNotify:
if (mode == MODE_IMAGE) { if (mode == MODE_IMAGE) {
win_set_cursor(&win, CURSOR_ARROW);
set_timeout(reset_cursor, TO_CURSOR_HIDE, true); set_timeout(reset_cursor, TO_CURSOR_HIDE, true);
reset_cursor();
} }
break; break;
} }