Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_event_system.c
| Show First 20 Lines • Show All 2,958 Lines • ▼ Show 20 Lines | #endif /* USE_GIZMO_MOUSE_PRIORITY_HACK */ | ||||
| } | } | ||||
| if (is_event_handle_all) { | if (is_event_handle_all) { | ||||
| if (action == WM_HANDLER_CONTINUE) { | if (action == WM_HANDLER_CONTINUE) { | ||||
| action |= WM_HANDLER_BREAK | WM_HANDLER_MODAL; | action |= WM_HANDLER_BREAK | WM_HANDLER_MODAL; | ||||
| } | } | ||||
| } | } | ||||
| const ListBase *groups = WM_gizmomap_group_list(gzmap); | |||||
| LISTBASE_FOREACH (wmGizmoGroup *, gzgroup, groups) { | |||||
| if (gzgroup->type->flag & WM_GIZMOGROUPTYPE_ATTACHED_TO_CURSOR) { | |||||
| ED_region_tag_redraw_editor_overlays(CTX_wm_region(C)); | |||||
| } | |||||
| } | |||||
| /* restore the area */ | /* restore the area */ | ||||
| CTX_wm_area_set(C, area); | CTX_wm_area_set(C, area); | ||||
| CTX_wm_region_set(C, region); | CTX_wm_region_set(C, region); | ||||
| return action; | return action; | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| ▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | else if (handler_base->poll == NULL || handler_base->poll(CTX_wm_region(C), event)) { | ||||
| OPERATOR_RETVAL_CHECK(op_retval); | OPERATOR_RETVAL_CHECK(op_retval); | ||||
| if ((op_retval & OPERATOR_CANCELLED) && drop->cancel) { | if ((op_retval & OPERATOR_CANCELLED) && drop->cancel) { | ||||
| drop->cancel(CTX_data_main(C), drag, drop); | drop->cancel(CTX_data_main(C), drag, drop); | ||||
| } | } | ||||
| action |= WM_HANDLER_BREAK; | action |= WM_HANDLER_BREAK; | ||||
| if (drop->gizmo_group[0]) { | |||||
| /* Redraw so gizmos disappear visually. */ | |||||
| ED_region_tag_redraw_editor_overlays(CTX_wm_region(C)); | |||||
| } | |||||
| /* Free the drags. */ | /* Free the drags. */ | ||||
| WM_drag_free_list(lb); | WM_drag_free_list(lb); | ||||
| WM_drag_free_list(&single_lb); | WM_drag_free_list(&single_lb); | ||||
| event->customdata = NULL; | event->customdata = NULL; | ||||
| event->custom = 0; | event->custom = 0; | ||||
| /* XXX fileread case. */ | /* XXX fileread case. */ | ||||
| ▲ Show 20 Lines • Show All 290 Lines • ▼ Show 20 Lines | if (region == NULL || !BLI_rcti_isect_pt_v(®ion->winrct, &event->prevx)) { | ||||
| wm_paintcursor_tag(C, wm->paintcursors.first, CTX_wm_region(C)); | wm_paintcursor_tag(C, wm->paintcursors.first, CTX_wm_region(C)); | ||||
| CTX_wm_area_set(C, area); | CTX_wm_area_set(C, area); | ||||
| CTX_wm_region_set(C, region); | CTX_wm_region_set(C, region); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void wm_event_drag_and_drop_test(wmWindowManager *wm, wmWindow *win, wmEvent *event) | static void wm_event_drag_and_drop_test(bContext *C, | ||||
| wmWindowManager *wm, | |||||
| wmWindow *win, | |||||
| wmEvent *event) | |||||
| { | { | ||||
| bScreen *screen = WM_window_get_active_screen(win); | bScreen *screen = WM_window_get_active_screen(win); | ||||
| if (BLI_listbase_is_empty(&wm->drags)) { | if (BLI_listbase_is_empty(&wm->drags)) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (event->type == MOUSEMOVE || ISKEYMODIFIER(event->type)) { | if (event->type == MOUSEMOVE || ISKEYMODIFIER(event->type)) { | ||||
| screen->do_draw_drag = true; | screen->do_draw_drag = true; | ||||
| } | } | ||||
| else if (event->type == EVT_ESCKEY) { | else if (event->type == EVT_ESCKEY) { | ||||
| ED_region_tag_redraw_editor_overlays(CTX_wm_region(C)); | |||||
| WM_drag_free_list(&wm->drags); | WM_drag_free_list(&wm->drags); | ||||
| screen->do_draw_drag = true; | screen->do_draw_drag = true; | ||||
| } | } | ||||
| else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { | else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { | ||||
| event->type = EVT_DROP; | event->type = EVT_DROP; | ||||
| /* Create customdata, first free existing. */ | /* Create customdata, first free existing. */ | ||||
| ▲ Show 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | #endif | ||||
| if (screen->tool_tip && screen->tool_tip->timer) { | if (screen->tool_tip && screen->tool_tip->timer) { | ||||
| if ((event->type == TIMER) && (event->customdata == screen->tool_tip->timer)) { | if ((event->type == TIMER) && (event->customdata == screen->tool_tip->timer)) { | ||||
| WM_tooltip_init(C, win); | WM_tooltip_init(C, win); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Check dragging, creates new event or frees, adds draw tag. */ | /* Check dragging, creates new event or frees, adds draw tag. */ | ||||
| wm_event_drag_and_drop_test(wm, win, event); | wm_event_drag_and_drop_test(C, wm, win, event); | ||||
| /* Builtin tweak, if action is break it removes tweak. */ | /* Builtin tweak, if action is break it removes tweak. */ | ||||
| wm_tweakevent_test(C, event, action); | wm_tweakevent_test(C, event, action); | ||||
| if ((action & WM_HANDLER_BREAK) == 0) { | if ((action & WM_HANDLER_BREAK) == 0) { | ||||
| /* NOTE: setting subwin active should be done here, after modal handlers have been done. */ | /* NOTE: setting subwin active should be done here, after modal handlers have been done. */ | ||||
| if (event->type == MOUSEMOVE) { | if (event->type == MOUSEMOVE) { | ||||
| /* State variables in screen, cursors. | /* State variables in screen, cursors. | ||||
| ▲ Show 20 Lines • Show All 1,944 Lines • Show Last 20 Lines | |||||