diff options
author | Ton Roosendaal <ton@blender.org> | 2006-07-06 16:50:48 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-07-06 16:50:48 +0400 |
commit | cd976bfd427da41eaccb81cb87596dcf87b9ba7f (patch) | |
tree | ed088ebc2535a612860c7c516f56327665ab9f76 /source/blender/src/screendump.c | |
parent | 80dda381f3dee10db4f2b477402e3d9a4f13ed87 (diff) |
Bugfix #4628
Ancient issue in making screendumps in Blender. It used to support making
dumps of popup menus, but that disappeared a while ago. However, when you
press CTRL+F3 in a menu now, Blender hangs in some eternal loop in ghost.
This commit fixes making menu screendumps (nice for docs!).
- press CTRL+F3 *twice* for an exact copy of a menu. (first press exits
menu, 2nd press opens filewindow)
- note, it is ALT+CTRL+F3 in OSX
- what is saved is only the topmost open level of a menu
- full-screen dumps work too by holding SHIFT extra.
Diffstat (limited to 'source/blender/src/screendump.c')
-rw-r--r-- | source/blender/src/screendump.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/src/screendump.c b/source/blender/src/screendump.c index fc17d0a5759..2b40d8e7171 100644 --- a/source/blender/src/screendump.c +++ b/source/blender/src/screendump.c @@ -117,25 +117,27 @@ void write_screendump(char *name) /* get dump from frontbuffer */ void BIF_screendump(int fscreen) { - extern uiBut *UIbuttip; // interface.c + extern int uiIsMenu(int *x, int *y, int *sizex, int *sizey); + int ismenu; static int wasmenu= 0; int x=0, y=0; char imstr[64]; - if(wasmenu && UIbuttip==NULL) { + /* this sets dumpsx/y to zero if ismenu==0 */ + ismenu= uiIsMenu(&x, &y, &dumpsx, &dumpsy); + + if(wasmenu && !ismenu) { save_image_filesel_str(imstr); + strcat(imstr, " (Menu)"); activate_fileselect(FILE_SPECIAL, imstr, G.ima, write_screendump); wasmenu= 0; return; } - dumpsx= 0; - dumpsy= 0; - if(dumprect) MEM_freeN(dumprect); dumprect= NULL; - if(UIbuttip || (G.qual & LR_SHIFTKEY) || fscreen) { /* full screen */ + if((G.qual & LR_SHIFTKEY) || fscreen) { /* full screen */ x= 0; y= 0; @@ -144,7 +146,7 @@ void BIF_screendump(int fscreen) } else { - { /* a window */ + if(ismenu==0) { /* a window */ //int win= mywinget(); //bwin_getsuborigin(win, &x, &y); @@ -164,7 +166,7 @@ void BIF_screendump(int fscreen) glFinish(); glReadBuffer(GL_BACK); - if(UIbuttip==NULL) { + if(ismenu==0) { wasmenu= 0; save_image_filesel_str(imstr); activate_fileselect(FILE_SPECIAL, imstr, G.ima, write_screendump); |