Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/screen_edit.c
| Show All 29 Lines | |||||
| #include <string.h> | #include <string.h> | ||||
| #include <math.h> | #include <math.h> | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_userdef_types.h" | #include "DNA_userdef_types.h" | ||||
| #include "DNA_space_types.h" | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_depsgraph.h" | #include "BKE_depsgraph.h" | ||||
| #include "BKE_image.h" | #include "BKE_image.h" | ||||
| ▲ Show 20 Lines • Show All 1,371 Lines • ▼ Show 20 Lines | for (sa = scr->areabase.first; sa; sa = sa->next) { | ||||
| if (NULL == is_in_area_actionzone(sa, &event->x)) | if (NULL == is_in_area_actionzone(sa, &event->x)) | ||||
| break; | break; | ||||
| } | } | ||||
| if (sa) { | if (sa) { | ||||
| /* make overlap active when mouse over */ | /* make overlap active when mouse over */ | ||||
| for (ar = sa->regionbase.first; ar; ar = ar->next) { | for (ar = sa->regionbase.first; ar; ar = ar->next) { | ||||
| if (BLI_rcti_isect_pt_v(&ar->winrct, &event->x)) { | if (BLI_rcti_isect_pt_v(&ar->winrct, &event->x)) { | ||||
| scr->subwinactive = ar->swinid; | scr->subwinactive = ar->swinid; | ||||
| #ifdef WITH_IM_OVERTHESPOT | |||||
| if (oldswin != scr->subwinactive) { | |||||
| WM_window_IM_end(win); | |||||
| if (ar->type && ar->type->im_begin) | |||||
| ar->type->im_begin(C, ar); | |||||
| } | |||||
| #endif | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| else | else | ||||
| scr->subwinactive = scr->mainwin; | scr->subwinactive = scr->mainwin; | ||||
| /* check for redraw headers */ | /* check for redraw headers */ | ||||
| if (oldswin != scr->subwinactive) { | if (oldswin != scr->subwinactive) { | ||||
campbellbarton: this is really weak, would be better to have a callback per space type to ask for the cursor… | |||||
| for (sa = scr->areabase.first; sa; sa = sa->next) { | for (sa = scr->areabase.first; sa; sa = sa->next) { | ||||
| bool do_draw = false; | bool do_draw = false; | ||||
| for (ar = sa->regionbase.first; ar; ar = ar->next) | for (ar = sa->regionbase.first; ar; ar = ar->next) | ||||
| if (ar->swinid == oldswin || ar->swinid == scr->subwinactive) | if (ar->swinid == oldswin || ar->swinid == scr->subwinactive) | ||||
| do_draw = true; | do_draw = true; | ||||
| if (do_draw) { | if (do_draw) { | ||||
| ▲ Show 20 Lines • Show All 821 Lines • Show Last 20 Lines | |||||
this is really weak, would be better to have a callback per space type to ask for the cursor location.
(if its not enough to cache the location from the last draw)