Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_event_system.c
| Show First 20 Lines • Show All 1,131 Lines • ▼ Show 20 Lines | else if (retval & OPERATOR_RUNNING_MODAL) { | ||||
| /* grab cursor during blocking modal ops (X11) | /* grab cursor during blocking modal ops (X11) | ||||
| * Also check for macro | * Also check for macro | ||||
| */ | */ | ||||
| if (ot->flag & OPTYPE_BLOCKING || (op->opm && op->opm->type->flag & OPTYPE_BLOCKING)) { | if (ot->flag & OPTYPE_BLOCKING || (op->opm && op->opm->type->flag & OPTYPE_BLOCKING)) { | ||||
| int bounds[4] = {-1, -1, -1, -1}; | int bounds[4] = {-1, -1, -1, -1}; | ||||
| bool wrap; | bool wrap; | ||||
| if (op->opm) { | if (event == NULL) { | ||||
| wrap = false; | |||||
| } | |||||
| else if (op->opm) { | |||||
| wrap = (U.uiflag & USER_CONTINUOUS_MOUSE) && | wrap = (U.uiflag & USER_CONTINUOUS_MOUSE) && | ||||
| ((op->opm->flag & OP_IS_MODAL_GRAB_CURSOR) || (op->opm->type->flag & OPTYPE_GRAB_CURSOR)); | ((op->opm->flag & OP_IS_MODAL_GRAB_CURSOR) || (op->opm->type->flag & OPTYPE_GRAB_CURSOR)); | ||||
| } | } | ||||
| else { | else { | ||||
| wrap = (U.uiflag & USER_CONTINUOUS_MOUSE) && | wrap = (U.uiflag & USER_CONTINUOUS_MOUSE) && | ||||
| ((op->flag & OP_IS_MODAL_GRAB_CURSOR) || (ot->flag & OPTYPE_GRAB_CURSOR)); | ((op->flag & OP_IS_MODAL_GRAB_CURSOR) || (ot->flag & OPTYPE_GRAB_CURSOR)); | ||||
| } | } | ||||
| /* exception, cont. grab in header is annoying */ | /* exception, cont. grab in header is annoying */ | ||||
| if (wrap) { | if (wrap) { | ||||
| ARegion *ar = CTX_wm_region(C); | ARegion *ar = CTX_wm_region(C); | ||||
| if (ar && ar->regiontype == RGN_TYPE_HEADER) { | if (ar && ar->regiontype == RGN_TYPE_HEADER) { | ||||
| wrap = false; | wrap = false; | ||||
| } | } | ||||
| } | } | ||||
| if (wrap) { | if (wrap) { | ||||
| const rcti *winrect = NULL; | const rcti *winrect = NULL; | ||||
| ARegion *ar = CTX_wm_region(C); | ARegion *ar = CTX_wm_region(C); | ||||
| ScrArea *sa = CTX_wm_area(C); | ScrArea *sa = CTX_wm_area(C); | ||||
| if (ar && ar->regiontype == RGN_TYPE_WINDOW && event && | if (ar && ar->regiontype == RGN_TYPE_WINDOW && | ||||
| BLI_rcti_isect_pt_v(&ar->winrct, &event->x)) | BLI_rcti_isect_pt_v(&ar->winrct, &event->x)) | ||||
| { | { | ||||
| winrect = &ar->winrct; | winrect = &ar->winrct; | ||||
| } | } | ||||
| else if (sa && BLI_rcti_isect_pt_v(&sa->totrct, &event->x)) { | else if (sa && BLI_rcti_isect_pt_v(&sa->totrct, &event->x)) { | ||||
| winrect = &sa->totrct; | winrect = &sa->totrct; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,447 Lines • Show Last 20 Lines | |||||