[Bf-blender-cvs] [af980a2] master: Fix T37746: Presets in splash failed to redraw
Campbell Barton
noreply at git.blender.org
Tue Jun 9 13:55:47 CEST 2015
Commit: af980a20a46c9c865418cf60ddaf669e37587bfb
Author: Campbell Barton
Date: Tue Jun 9 21:54:47 2015 +1000
Branches: master
https://developer.blender.org/rBaf980a20a46c9c865418cf60ddaf669e37587bfb
Fix T37746: Presets in splash failed to redraw
===================================================================
M release/scripts/startup/bl_ui/space_userpref.py
M source/blender/windowmanager/intern/wm_operators.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index fcf63ba..0272f75 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -113,11 +113,11 @@ class USERPREF_MT_splash(Menu):
row.label("")
row = split.row()
row.label("Interaction:")
- # XXX, no redraws
- # text = bpy.path.display_name(context.window_manager.keyconfigs.active.name)
- # if not text:
- # text = "Blender (default)"
- row.menu("USERPREF_MT_appconfigs", text="Preset")
+
+ text = bpy.path.display_name(context.window_manager.keyconfigs.active.name)
+ if not text:
+ text = "Blender (default)"
+ row.menu("USERPREF_MT_appconfigs", text=text)
# only for addons
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 041ef6f..cd97293 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1853,17 +1853,10 @@ static void wm_block_splash_close(bContext *C, void *arg_block, void *UNUSED(arg
static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unused);
-/* XXX: hack to refresh splash screen with updated preset menu name,
- * since popup blocks don't get regenerated like panels do */
-static void wm_block_splash_refreshmenu(bContext *UNUSED(C), void *UNUSED(arg_block), void *UNUSED(arg))
+static void wm_block_splash_refreshmenu(bContext *C, void *UNUSED(arg_block), void *UNUSED(arg))
{
- /* ugh, causes crashes in other buttons, disabling for now until
- * a better fix */
-#if 0
- wmWindow *win = CTX_wm_window(C);
- UI_popup_block_close(C, win, arg_block);
- UI_popup_block_invoke(C, wm_block_create_splash, NULL);
-#endif
+ ARegion *ar_menu = CTX_wm_menu(C);
+ ED_region_tag_refresh_ui(ar_menu);
}
static int wm_resource_check_prev(void)
@@ -1945,7 +1938,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
/* 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] */
- UI_block_flag_enable(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_NO_WIN_CLIP);
+ UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_KEEP_OPEN | UI_BLOCK_NO_WIN_CLIP);
/* XXX splash scales with pixelsize, should become widget-units */
but = uiDefBut(block, UI_BTYPE_IMAGE, 0, "", 0, 0.5f * U.widget_unit, U.pixelsize * 501, U.pixelsize * 282, ibuf, 0.0, 0.0, 0, 0, ""); /* button owns the imbuf now */
More information about the Bf-blender-cvs
mailing list