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:
authorTon Roosendaal <ton@blender.org>2010-11-09 17:54:59 +0300
committerTon Roosendaal <ton@blender.org>2010-11-09 17:54:59 +0300
commit4c122988320d866b16a06ea4404d278bc8d13715 (patch)
treec1e9f16591f163607240ed742497ba5408cd4793 /source/blender/editors/screen
parent2b96175608a898f5fd00a56250551878e40ec9be (diff)
Bugfix #20812 (and probably others)
Issue: in user preferences window, using file selecting caused the the userpref window to be saved, and not closing. Reason: design error (by me) in using screen->full tag for denoting a temporarily screen (like file window). Fixed by using a new screen->temp variable for it. System remained unstable though, noticed another issue with freeing temp screens in wrong places. Seems nice stable now! Will check on the wiki for relarted issues now.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/screen_edit.c59
-rw-r--r--source/blender/editors/screen/screen_ops.c8
2 files changed, 27 insertions, 40 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index e3da9af4e2d..130916f4285 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1140,8 +1140,7 @@ void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen)
/* mark it available for use for other windows */
screen->winid= 0;
- /* before deleting the temp screen or we get invalid access */
- if (prevwin->screen->full != SCREENTEMP) {
+ if (prevwin->screen->temp == 0) {
/* use previous window if possible */
CTX_wm_window_set(C, prevwin);
} else {
@@ -1149,11 +1148,6 @@ void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen)
CTX_wm_window_set(C, NULL);
}
- /* if temp screen, delete it */
- if(screen->full == SCREENTEMP) {
- Main *bmain= CTX_data_main(C);
- free_libblock(&bmain->screen, screen);
- }
}
/* *********************************** */
@@ -1560,46 +1554,39 @@ ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa)
}
if(sa && sa->full) {
+ ScrArea *old;
short fulltype;
sc= sa->full; /* the old screen to restore */
oldscreen= win->screen; /* the one disappearing */
fulltype = sc->full;
+ sc->full= 0;
- /* refuse to go out of SCREENAUTOPLAY as long as G_FLAGS_AUTOPLAY
- is set */
-
- if (fulltype != SCREENAUTOPLAY || (G.flags & G_FILE_AUTOPLAY) == 0) {
- ScrArea *old;
+ /* removed: SCREENAUTOPLAY exception here */
+
+ /* find old area */
+ for(old= sc->areabase.first; old; old= old->next)
+ if(old->full) break;
+ if(old==NULL) {
+ if (G.f & G_DEBUG)
+ printf("something wrong in areafullscreen\n");
+ return NULL;
+ }
- sc->full= 0;
+ area_copy_data(old, sa, 1); /* 1 = swap spacelist */
+ if (sa->flag & AREA_TEMP_INFO) sa->flag &= ~AREA_TEMP_INFO;
+ old->full= NULL;
- /* find old area */
- for(old= sc->areabase.first; old; old= old->next)
- if(old->full) break;
- if(old==NULL) {
- if (G.f & G_DEBUG)
- printf("something wrong in areafullscreen\n");
- return NULL;
- }
- // old feature described below (ton)
- // in autoplay screens the headers are disabled by
- // default. So use the old headertype instead
-
- area_copy_data(old, sa, 1); /* 1 = swap spacelist */
- if (sa->flag & AREA_TEMP_INFO) sa->flag &= ~AREA_TEMP_INFO;
- old->full= NULL;
+ /* animtimer back */
+ sc->animtimer= oldscreen->animtimer;
+ oldscreen->animtimer= NULL;
- /* animtimer back */
- sc->animtimer= oldscreen->animtimer;
- oldscreen->animtimer= NULL;
+ ED_screen_set(C, sc);
- ED_screen_set(C, sc);
+ free_screen(oldscreen);
+ free_libblock(&CTX_data_main(C)->screen, oldscreen);
- free_screen(oldscreen);
- free_libblock(&CTX_data_main(C)->screen, oldscreen);
- }
}
else {
ScrArea *newa;
@@ -1614,7 +1601,7 @@ ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa)
*/
oldscreen->full = SCREENFULL;
- BLI_snprintf(newname, sizeof(newname), "%s-%s", oldscreen->id.name+2, "temp");
+ BLI_snprintf(newname, sizeof(newname), "%s-%s", oldscreen->id.name+2, "full");
sc= ED_screen_add(win, oldscreen->scene, newname);
sc->full = SCREENFULL; // XXX
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 7cdd19e435b..1c47065ac76 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -1708,6 +1708,10 @@ static int screen_set_exec(bContext *C, wmOperator *op)
int tot= BLI_countlist(&CTX_data_main(C)->screen);
int delta= RNA_int_get(op->ptr, "delta");
+ /* temp screens are for userpref or render display */
+ if(screen->temp)
+ return OPERATOR_CANCELLED;
+
/* return to previous state before switching screens */
if(sa && sa->full)
ED_screen_full_restore(C, sa);
@@ -2817,7 +2821,6 @@ static void SCREEN_OT_back_to_previous(struct wmOperatorType *ot)
static int userpref_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
- ScrArea *sa;
rcti rect;
int sizex, sizey;
@@ -2833,9 +2836,6 @@ static int userpref_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *ev
/* changes context! */
WM_window_open_temp(C, &rect, WM_WINDOW_USERPREFS);
- sa= CTX_wm_area(C);
-
-
return OPERATOR_FINISHED;
}