diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-02-02 06:13:57 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-02-02 06:16:53 +0300 |
commit | 3b92a9472c4cee8df98eb79e6be6b2f8b14c8b59 (patch) | |
tree | 1655af101632dfb858371345e2f4d8040c4c7f33 /source/blender/editors/screen/area.c | |
parent | 3822a9c01aaa70d119b67f7a86a0a17d25eabc93 (diff) |
UI: update dynamic tips
Useful for progress ETA to continuously update.
This adds API option not to activate new regions GL state which isn't needed in many cases.
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 0e4dd701a58..d39b70802fe 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1339,7 +1339,7 @@ static void area_calc_totrct(ScrArea *sa, int sizex, int sizey) /* used for area initialize below */ -static void region_subwindow(wmWindow *win, ARegion *ar) +static void region_subwindow(wmWindow *win, ARegion *ar, bool activate) { bool hidden = (ar->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) != 0; @@ -1351,10 +1351,12 @@ static void region_subwindow(wmWindow *win, ARegion *ar) wm_subwindow_close(win, ar->swinid); ar->swinid = 0; } - else if (ar->swinid == 0) - ar->swinid = wm_subwindow_open(win, &ar->winrct); - else - wm_subwindow_position(win, ar->swinid, &ar->winrct); + else if (ar->swinid == 0) { + ar->swinid = wm_subwindow_open(win, &ar->winrct, activate); + } + else { + wm_subwindow_position(win, ar->swinid, &ar->winrct, activate); + } } static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *handlers, int flag) @@ -1457,7 +1459,7 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa) /* region windows, default and own handlers */ for (ar = sa->regionbase.first; ar; ar = ar->next) { - region_subwindow(win, ar); + region_subwindow(win, ar, false); if (ar->swinid) { /* default region handlers */ @@ -1498,10 +1500,10 @@ void ED_region_update_rect(bContext *C, ARegion *ar) void ED_region_init(bContext *C, ARegion *ar) { // ARegionType *at = ar->type; - + /* refresh can be called before window opened */ - region_subwindow(CTX_wm_window(C), ar); - + region_subwindow(CTX_wm_window(C), ar, false); + region_update_rect(ar); } |