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:
authormano-wii <germano.costa@ig.com.br>2018-08-14 22:10:35 +0300
committermano-wii <germano.costa@ig.com.br>2018-08-14 22:10:35 +0300
commita5d72bac8e2309470781d6a77335583bbfa0a903 (patch)
tree0fadc60bba136934539c08379ce1e2de5d12ac0a /source/blender/windowmanager
parentb2966b70fe9f3cf76af52800e88fbb9395b44077 (diff)
Fix (unreported): misuse of GL Context when creating new window and/or rendering.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_window.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index f391c92b4ca..c5226a0b809 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -631,6 +631,10 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm
wm_get_screensize(&scr_w, &scr_h);
posy = (scr_h - win->posy - win->sizey);
+ /* Clear drawable so we can set the new window. */
+ wmWindow *prev_windrawable = wm->windrawable;
+ wm_window_clear_drawable(wm);
+
ghostwin = GHOST_CreateWindow(g_system, title,
win->posx, posy, win->sizex, win->sizey,
(GHOST_TWindowState)win->windowstate,
@@ -640,9 +644,6 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm
if (ghostwin) {
GHOST_RectangleHandle bounds;
- /* Clear drawable so we can set the new window. */
- wm_window_clear_drawable(wm);
-
win->gpuctx = GPU_context_create();
/* needed so we can detect the graphics card below */
@@ -650,8 +651,7 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm
/* Set window as drawable upon creation. Note this has already been
* it has already been activated by GHOST_CreateWindow. */
- bool activate = false;
- wm_window_set_drawable(wm, win, activate);
+ wm_window_set_drawable(wm, win, false);
win->ghostwin = ghostwin;
GHOST_SetWindowUserData(ghostwin, win); /* pointer back */
@@ -689,6 +689,9 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm
/* standard state vars for window */
GPU_state_init();
}
+ else {
+ wm_window_set_drawable(wm, prev_windrawable, false);
+ }
}
/**