Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_event_system.cc
| Show First 20 Lines • Show All 5,923 Lines • ▼ Show 20 Lines | if (ELEM(region->regiontype, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS)) { | ||||
| region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); | region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); | ||||
| } | } | ||||
| /* Detect changes to the state. */ | /* Detect changes to the state. */ | ||||
| { | { | ||||
| bToolRef *tref = nullptr; | bToolRef *tref = nullptr; | ||||
| if ((region->regiontype == RGN_TYPE_WINDOW) && | if ((region->regiontype == RGN_TYPE_WINDOW) && | ||||
| ((1 << area->spacetype) & WM_TOOLSYSTEM_SPACE_MASK)) { | ((1 << area->spacetype) & WM_TOOLSYSTEM_SPACE_MASK)) { | ||||
| const Scene*scene = WM_window_get_active_scene(win); | |||||
| ViewLayer *view_layer = WM_window_get_active_view_layer(win); | ViewLayer *view_layer = WM_window_get_active_view_layer(win); | ||||
| WorkSpace *workspace = WM_window_get_active_workspace(win); | WorkSpace *workspace = WM_window_get_active_workspace(win); | ||||
| bToolKey tkey{}; | bToolKey tkey{}; | ||||
| tkey.space_type = area->spacetype; | tkey.space_type = area->spacetype; | ||||
| tkey.mode = WM_toolsystem_mode_from_spacetype(view_layer, area, area->spacetype); | tkey.mode = WM_toolsystem_mode_from_spacetype(scene, view_layer, area, area->spacetype); | ||||
| tref = WM_toolsystem_ref_find(workspace, &tkey); | tref = WM_toolsystem_ref_find(workspace, &tkey); | ||||
| } | } | ||||
| wm_event_cursor_store(&cd->state, win->eventstate, area->spacetype, region->regiontype, tref); | wm_event_cursor_store(&cd->state, win->eventstate, area->spacetype, region->regiontype, tref); | ||||
| if (memcmp(&cd->state, &cd_prev.state, sizeof(cd->state)) == 0) { | if (memcmp(&cd->state, &cd_prev.state, sizeof(cd->state)) == 0) { | ||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines | |||||