Fix T37746: Presets in splash failed to redraw
authorCampbell Barton <ideasman42@gmail.com>
Tue, 9 Jun 2015 11:54:47 +0000 (21:54 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 9 Jun 2015 11:55:35 +0000 (21:55 +1000)
release/scripts/startup/bl_ui/space_userpref.py
source/blender/windowmanager/intern/wm_operators.c

index fcf63ba53538446578fd4e826ef181019812874d..0272f752bab1ac147595f6e7c6c5af6d643fa8f7 100644 (file)
@@ -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
index 041ef6f82829b38532f8265a17bd8f7d5e8a010a..cd97293516dd7429fdf019dd87ee5c87ceaec5ae 100644 (file)
@@ -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 */