Fix #29546: missing 3d view redraw after game exit with overlap draw mode,
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 8 Dec 2011 11:37:04 +0000 (11:37 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 8 Dec 2011 11:37:04 +0000 (11:37 +0000)
when launching game from properties editor. Also fix popup/menu still
showing during game when starting from the top menu.

source/blender/editors/space_view3d/view3d_view.c

index 90f617513a525008f68d546061f0c07c73c07ad2..89f859d09765e9bf4491f4198469deba5b90fa48 100644 (file)
@@ -1715,6 +1715,10 @@ static int game_engine_exec(bContext *C, wmOperator *op)
        if(!ED_view3d_context_activate(C))
                return OPERATOR_CANCELLED;
        
+       /* redraw to hide any menus/popups, we don't go back to
+          the window manager until after this operator exits */
+       WM_redraw_windows(C);
+
        rv3d= CTX_wm_region_view3d(C);
        /* sa= CTX_wm_area(C); */ /* UNUSED */
        ar= CTX_wm_region(C);
@@ -1750,6 +1754,8 @@ static int game_engine_exec(bContext *C, wmOperator *op)
                CTX_wm_window_set(C, NULL);
        }
        
+       ED_area_tag_redraw(CTX_wm_area(C));
+
        if(prevwin) {
                /* restore context, in case it changed in the meantime, for
                   example by working in another window or closing it */
@@ -1763,8 +1769,6 @@ static int game_engine_exec(bContext *C, wmOperator *op)
        //XXX restore_all_scene_cfra(scene_cfra_store);
        set_scene_bg(CTX_data_main(C), startscene);
        //XXX scene_update_for_newframe(bmain, scene, scene->lay);
-       
-       ED_area_tag_redraw(CTX_wm_area(C));
 
        return OPERATOR_FINISHED;
 #else