Krolyxon
Commit ee908ca

Branches

Refs →

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.
Author
Bert Münnich
Date
2017-10-05 13:49 +0200
Parent
d81442f
Commit
ee908ca0a197ac579ab8abc5695c9ce421a96a21

+3 −3

2 files changed

  1. M commands.c +1 −1
  2. M main.c +2 −2
M commands.c View
@@ -351,8 +351,8 @@ bool ci_drag(arg_t _)
351351 x = e.xmotion.x;
352352 y = e.xmotion.y;
353353 }
354− win_set_cursor(&win, CURSOR_ARROW);
355354 set_timeout(reset_cursor, TO_CURSOR_HIDE, true);
355+ reset_cursor();
356356
357357 return true;
358358 }
M main.c View
@@ -622,8 +622,8 @@ void on_buttonpress(XButtonEvent *bev)
622622 static Time firstclick;
623623
624624 if (mode == MODE_IMAGE) {
625− win_set_cursor(&win, CURSOR_ARROW);
626625 set_timeout(reset_cursor, TO_CURSOR_HIDE, true);
626+ reset_cursor();
627627
628628 for (i = 0; i < ARRLEN(buttons); i++) {
629629 if (buttons[i].button == bev->button &&
@@ -783,8 +783,8 @@ void run(void)
783783 break;
784784 case MotionNotify:
785785 if (mode == MODE_IMAGE) {
786− win_set_cursor(&win, CURSOR_ARROW);
787786 set_timeout(reset_cursor, TO_CURSOR_HIDE, true);
787+ reset_cursor();
788788 }
789789 break;
790790 }