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/windowmanager/intern | |
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/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_subwindow.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index 7dade62347c..a0279e56ba1 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -192,7 +192,7 @@ void wm_subwindow_rect_set(wmWindow *win, int swinid, const rcti *rect) /* always sets pixel-precise 2D window/view matrices */ /* coords is in whole pixels. xmin = 15, xmax = 16: means window is 2 pix big */ -int wm_subwindow_open(wmWindow *win, const rcti *winrct) +int wm_subwindow_open(wmWindow *win, const rcti *winrct, bool activate) { wmSubWindow *swin; int width, height; @@ -208,18 +208,19 @@ int wm_subwindow_open(wmWindow *win, const rcti *winrct) swin->swinid = freewinid; swin->winrct = *winrct; - /* and we appy it all right away */ - wmSubWindowSet(win, swin->swinid); - - /* extra service */ - wm_swin_size_get(swin, &width, &height); - wmOrtho2_pixelspace(width, height); - glLoadIdentity(); + if (activate) { + /* and we appy it all right away */ + wmSubWindowSet(win, swin->swinid); + + /* extra service */ + wm_swin_size_get(swin, &width, &height); + wmOrtho2_pixelspace(width, height); + glLoadIdentity(); + } return swin->swinid; } - void wm_subwindow_close(wmWindow *win, int swinid) { wmSubWindow *swin = swin_from_swinid(win, swinid); @@ -237,7 +238,7 @@ void wm_subwindow_close(wmWindow *win, int swinid) } /* pixels go from 0-99 for a 100 pixel window */ -void wm_subwindow_position(wmWindow *win, int swinid, const rcti *winrct) +void wm_subwindow_position(wmWindow *win, int swinid, const rcti *winrct, bool activate) { wmSubWindow *swin = swin_from_swinid(win, swinid); @@ -267,10 +268,12 @@ void wm_subwindow_position(wmWindow *win, int swinid, const rcti *winrct) if (swin->winrct.ymax > winsize_y) swin->winrct.ymax = winsize_y; - /* extra service */ - wmSubWindowSet(win, swinid); - wm_swin_size_get(swin, &width, &height); - wmOrtho2_pixelspace(width, height); + if (activate) { + /* extra service */ + wmSubWindowSet(win, swinid); + wm_swin_size_get(swin, &width, &height); + wmOrtho2_pixelspace(width, height); + } } else { printf("%s: Internal error, bad winid: %d\n", __func__, swinid); |