Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-01-30 16:22:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-30 16:22:02 +0400
commit54223ed05b7e2840865b5e46ed6d43573ff2b4ae (patch)
tree318ecb1a6b2afa8278829f06dfb0a50c0de06b36 /source/blender/blenkernel/intern/screen.c
parentc8015a27888a4c87360b1af158fc9b70bd4112ae (diff)
Add active region for operator execution.
This means you can for example, uv unwrap in quad-view and change settings in the toolbar without defaulting back to the first quad-view region available. This may be displayed to the user later, for now this is set on executing registrable operators.
Diffstat (limited to 'source/blender/blenkernel/intern/screen.c')
-rw-r--r--source/blender/blenkernel/intern/screen.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 95b72d0185c..01f57b95378 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -355,6 +355,20 @@ ARegion *BKE_area_find_region_type(ScrArea *sa, int type)
return NULL;
}
+ARegion *BKE_area_find_region_active_win(ScrArea *sa)
+{
+ if (sa) {
+ ARegion *ar = BLI_findlink(&sa->regionbase, sa->region_active_win);
+ if (ar && (ar->regiontype == RGN_TYPE_WINDOW)) {
+ return ar;
+ }
+
+ /* fallback to any */
+ return BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+ }
+ return NULL;
+}
+
/* note, using this function is generally a last resort, you really want to be
* using the context when you can - campbell
* -1 for any type */