fix [#32938] The Splash Screen doesn't show up correctly .....

applying window clipping to the splash on startup gave strange/annoying problems.
This commit is contained in:
Campbell Barton
2012-10-25 02:57:55 +00:00
parent 1298357581
commit 95b8a64889
3 changed files with 11 additions and 3 deletions

View File

@@ -108,7 +108,7 @@ typedef struct uiLayout uiLayout;
#define UI_BLOCK_REDRAW 2
#define UI_BLOCK_SEARCH_MENU 4
#define UI_BLOCK_NUMSELECT 8
/*#define UI_BLOCK_ENTER_OK 16*/ /*UNUSED*/
#define UI_BLOCK_NO_WIN_CLIP 16 /* don't apply window clipping */ /* was UI_BLOCK_ENTER_OK */
#define UI_BLOCK_CLIPBOTTOM 32
#define UI_BLOCK_CLIPTOP 64
#define UI_BLOCK_MOVEMOUSE_QUIT 128

View File

@@ -1548,7 +1548,11 @@ static void ui_block_region_draw(const bContext *C, ARegion *ar)
static void ui_popup_block_clip(wmWindow *window, uiBlock *block)
{
int winx, winy;
if (block->flag & UI_BLOCK_NO_WIN_CLIP) {
return;
}
wm_window_get_size(window, &winx, &winy);
if (block->rect.xmin < MENU_SHADOW_SIDE)

View File

@@ -1320,7 +1320,11 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
#endif /* WITH_BUILDINFO */
block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN);
/* note on UI_BLOCK_NO_WIN_CLIP, the window size is not always synchronized
* with the OS when the splash shows, window clipping in this case gives
* ugly results and clipping the splash isn't useful anyway, just disable it [#32938] */
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_NO_WIN_CLIP);
but = uiDefBut(block, BUT_IMAGE, 0, "", 0, 10, 501, 282, ibuf, 0.0, 0.0, 0, 0, ""); /* button owns the imbuf now */
uiButSetFunc(but, wm_block_splash_close, block, NULL);