- if(mwindow->session->current_operation == DRAG_ASSET ||
- mwindow->session->current_operation == DRAG_VTRANSITION ||
- mwindow->session->current_operation == DRAG_VEFFECT)
- {
- int old_status = mwindow->session->ccanvas_highlighted;
- int cursor_x = get_relative_cursor_x();
- int cursor_y = get_relative_cursor_y();
-
- mwindow->session->ccanvas_highlighted = get_cursor_over_window() &&
- cursor_x >= canvas->x &&
- cursor_x < canvas->x + canvas->w &&
- cursor_y >= canvas->y &&
- cursor_y < canvas->y + canvas->h;
-
-
- if(old_status != mwindow->session->ccanvas_highlighted)
- canvas->draw_refresh();
- }
+ if(mwindow->session->current_operation != DRAG_ASSET &&
+ mwindow->session->current_operation != DRAG_VTRANSITION &&
+ mwindow->session->current_operation != DRAG_VEFFECT) return;
+ int need_highlight = cursor_above() && get_cursor_over_window();
+ if( highlighted == need_highlight ) return;
+ highlighted = need_highlight;
+ canvas->draw_refresh();