diff options
author | Ton Roosendaal <ton@blender.org> | 2008-12-15 21:43:18 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2008-12-15 21:43:18 +0300 |
commit | aad5e497013dc37acc1913fbbeec4bc0d16ccbc6 (patch) | |
tree | 8fa291f6d274f18090042e6633d8a588b6742e95 | |
parent | 628f02d57482e987069c6b9969da309db84dbadd (diff) |
2.5
Small improvements;
- switch spacedata now doesn't cause full screen refresh and draw
- cursor switching is not part of SCREEN_CHANGED notifier, this
makes area dragging ugly.
-rw-r--r-- | source/blender/editors/include/ED_screen.h | 3 | ||||
-rw-r--r-- | source/blender/editors/screen/area.c | 6 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 31 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 2 |
5 files changed, 22 insertions, 22 deletions
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 2cb394da2b0..8be027d3400 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -36,6 +36,7 @@ struct wmWindowManager; struct wmWindow; struct wmNotifier; +struct wmEvent; struct SpaceType; struct AreagionType; struct uiBlock; @@ -65,7 +66,7 @@ void ED_screen_draw(struct wmWindow *win); void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win); void ED_screen_do_listen(struct wmWindow *win, struct wmNotifier *note); bScreen *ED_screen_duplicate(struct wmWindow *win, struct bScreen *sc); -void ED_screen_set_subwinactive(struct wmWindow *win); +void ED_screen_set_subwinactive(struct wmWindow *win, struct wmEvent *event); void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen); void ED_operatortypes_screen(void); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 81bb67bb85b..fb1390b82dd 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -538,9 +538,13 @@ static void newspace(bContext *C, ScrArea *sa, int type) slold->regionbase= sa->regionbase; sa->regionbase= sl->regionbase; sl->regionbase.first= sl->regionbase.last= NULL; + + ED_area_initialize(C->wm, C->window, sa); } } + /* tell WM to refresh, cursor types etc */ + WM_event_add_mousemove(C); } } @@ -586,7 +590,7 @@ static char *windowtype_pup(void) static void spacefunc(struct bContext *C, void *arg1, void *arg2) { newspace(C, C->area, C->area->butspacetype); - WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL); + WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL); } /* returns offset for next button in header */ diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 2cf480dc204..a05ee3d8450 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -994,9 +994,6 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win) if(G.f & G_DEBUG) printf("set screen\n"); win->screen->do_refresh= 0; - - /* cursor types too */ - ED_screen_set_subwinactive(win); } /* file read, set all screens, ... */ @@ -1077,15 +1074,15 @@ static void screen_cursor_set(wmWindow *win, wmEvent *event) /* called in wm_event_system.c. sets state var in screen */ -void ED_screen_set_subwinactive(wmWindow *win) +void ED_screen_set_subwinactive(wmWindow *win, wmEvent *event) { if(win->screen) { - wmEvent *event= win->eventstate; + bScreen *scr= win->screen; ScrArea *sa; ARegion *ar; - int oldswin= win->screen->subwinactive; - - for(sa= win->screen->areabase.first; sa; sa= sa->next) { + int oldswin= scr->subwinactive; + + for(sa= scr->areabase.first; sa; sa= sa->next) { if(event->x > sa->totrct.xmin && event->x < sa->totrct.xmax) if(event->y > sa->totrct.ymin && event->y < sa->totrct.ymax) if(NULL==is_in_area_actionzone(sa, event->x, event->y)) @@ -1094,20 +1091,20 @@ void ED_screen_set_subwinactive(wmWindow *win) if(sa) { for(ar= sa->regionbase.first; ar; ar= ar->next) { if(BLI_in_rcti(&ar->winrct, event->x, event->y)) - win->screen->subwinactive= ar->swinid; + scr->subwinactive= ar->swinid; } } else - win->screen->subwinactive= win->screen->mainwin; + scr->subwinactive= scr->mainwin; /* check for redraw headers */ - if(oldswin!=win->screen->subwinactive) { + if(oldswin!=scr->subwinactive) { - for(sa= win->screen->areabase.first; sa; sa= sa->next) { + for(sa= scr->areabase.first; sa; sa= sa->next) { int do_draw= 0; for(ar= sa->regionbase.first; ar; ar= ar->next) - if(ar->swinid==oldswin || ar->swinid==win->screen->subwinactive) + if(ar->swinid==oldswin || ar->swinid==scr->subwinactive) do_draw= 1; if(do_draw) { @@ -1119,14 +1116,14 @@ void ED_screen_set_subwinactive(wmWindow *win) } /* cursors, for time being set always on edges, otherwise aregion doesnt switch */ - if(win->screen->subwinactive==win->screen->mainwin) { + if(scr->subwinactive==scr->mainwin) { screen_cursor_set(win, event); } - else if(oldswin!=win->screen->subwinactive) { + else if(oldswin!=scr->subwinactive) { /* cursor space type switching */ - for(sa= win->screen->areabase.first; sa; sa= sa->next) { + for(sa= scr->areabase.first; sa; sa= sa->next) { for(ar= sa->regionbase.first; ar; ar= ar->next) { - if(ar->swinid==win->screen->subwinactive) { + if(ar->swinid==scr->subwinactive) { if(sa->type->cursor) sa->type->cursor(win, ar); else diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 605d076a7bc..aeb3899409f 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -649,7 +649,7 @@ void wm_event_do_handlers(bContext *C) /* XXX to solve, here screen handlers? */ if(!wm_event_always_pass(event)) - ED_screen_set_subwinactive(win); /* state variables in screen */ + ED_screen_set_subwinactive(win, event); /* state variables in screen */ for(sa= win->screen->areabase.first; sa; sa= sa->next) { if(wm_event_always_pass(event) || wm_event_prev_inside_i(event, &sa->totrct)) { diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 644f1a95c8e..6f723d02f30 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -413,8 +413,6 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private) win->eventstate->x= cx; win->eventstate->y= (win->sizey-1) - cy; - ED_screen_set_subwinactive(win); /* active subwindow in screen */ - wm_window_make_drawable(C, win); break; } |