diff options
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 14 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 15 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 13 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 6 |
5 files changed, 34 insertions, 19 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 75b27505995..1ace7bce09c 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -157,10 +157,14 @@ typedef struct wmNotifier { /* data type, 256 entries is enough, it can overlap */ #define NOTE_DATA 0x00FF0000 - /* windowmanager */ + /* NC_WM windowmanager */ #define ND_FILEREAD (1<<16) - /* Scene */ + /* NC_SCREEN screen */ +#define ND_SCREENBROWSE (1<<16) +#define ND_SCENEBROWSE (2<<16) + + /* NC_SCENE Scene */ #define ND_MARKERS (2<<16) #define ND_FRAME (3<<16) #define ND_RENDER_OPTIONS (4<<16) @@ -172,7 +176,7 @@ typedef struct wmNotifier { #define ND_RENDER_RESULT (10<<16) #define ND_COMPO_RESULT (11<<16) - /* Object */ + /* NC_OBJECT Object */ #define ND_TRANSFORM (16<<16) #define ND_OB_SHADING (17<<16) #define ND_POSE (18<<16) @@ -184,11 +188,11 @@ typedef struct wmNotifier { #define ND_KEYS (24<<16) #define ND_GEOM_DATA (25<<16) - /* Material */ + /* NC_MATERIAL Material */ #define ND_SHADING (30<<16) #define ND_SHADING_DRAW (31<<16) - /* Lamp */ + /* NC_LAMP Lamp */ #define ND_LIGHTING (44<<16) #define ND_LIGHTING_DRAW (45<<16) #define ND_SKY (46<<16) diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 0b00d955a8a..56d8788fdcb 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -131,8 +131,9 @@ void wm_add_default(bContext *C) CTX_wm_manager_set(C, wm); win= wm_window_new(C); win->screen= screen; - if(screen) - BLI_strncpy(win->screenname, screen->id.name+2, 21); + screen->winid= win->winid; + BLI_strncpy(win->screenname, screen->id.name+2, 21); + wm->winactive= win; wm_window_make_drawable(C, win); } diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 7c9e0d905bf..def9d7351ac 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -130,20 +130,27 @@ void wm_event_do_notifiers(bContext *C) if(wm==NULL) return; - /* cache & catch WM level notifiers, such as frame change */ + /* cache & catch WM level notifiers, such as frame change, scene/screen set */ /* XXX todo, multiwindow scenes */ for(win= wm->windows.first; win; win= win->next) { int do_anim= 0; + CTX_wm_window_set(C, win); + for(note= wm->queue.first; note; note= note->next) { - if(note->window==win) - if(note->category==NC_SCENE) + if(note->window==win) { + if(note->category==NC_SCREEN) { + if(note->data==ND_SCREENBROWSE) + ED_screen_set(C, note->reference); // XXX hrms, think this over! + } + else if(note->category==NC_SCENE) { if(note->data==ND_FRAME) do_anim= 1; + } + } } if(do_anim) { /* depsgraph gets called, might send more notifiers */ - CTX_wm_window_set(C, win); ED_update_for_newframe(C, 1); } } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 4ff549c06da..04583c45ec0 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -449,20 +449,23 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist) /* we've read file without wm..., keep current one entirely alive */ if(G.main->wm.first==NULL) { + bScreen *screen= CTX_wm_screen(C); + /* match oldwm to new dbase, only old files */ for(wm= oldwmlist->first; wm; wm= wm->id.next) { for(win= wm->windows.first; win; win= win->next) { /* all windows get active screen from file */ - win->screen= CTX_wm_screen(C); - BLI_strncpy(win->screenname, win->screen->id.name+2, 21); + if(screen->winid==0) + win->screen= screen; + else + win->screen= ED_screen_duplicate(win, screen); - if(win->screen->winid==0) - win->screen->winid= win->winid; + BLI_strncpy(win->screenname, win->screen->id.name+2, 21); + win->screen->winid= win->winid; } } - /* XXX still solve, case where multiple windows open */ G.main->wm= *oldwmlist; diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index e5af93f3dd8..67eb043b1cf 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -123,7 +123,7 @@ void wm_window_free(bContext *C, wmWindow *win) static int find_free_winid(wmWindowManager *wm) { wmWindow *win; - int id= 0; + int id= 1; for(win= wm->windows.first; win; win= win->next) if(id <= win->winid) @@ -155,8 +155,8 @@ wmWindow *wm_window_copy(bContext *C, wmWindow *winorig) win->sizex= winorig->sizex; win->sizey= winorig->sizey; - win->screen= ED_screen_duplicate(win, winorig->screen); - BLI_strncpy(win->screenname, win->screen->id.name+2, 21); + /* duplicate assigns to window */ + ED_screen_duplicate(win, winorig->screen); win->screen->do_refresh= 1; win->screen->do_draw= 1; |