Page MenuHome
Paste P691

Quick patch to show in the splashcreen if Blender is running with or without COW enabled
ActivePublic

Authored by Inês Almeida (brita_) on May 19 2018, 4:26 PM.
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 70be609dba3..cc0549dee31 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1865,6 +1865,7 @@ static int wm_resource_check_prev(void)
}
}
+#include "DEG_depsgraph.h"
static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(arg))
{
uiBlock *block;
@@ -1904,6 +1905,13 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
hash_width = (int)BLF_width(style->widgetlabel.uifont_id, hash_buf, sizeof(hash_buf)) + U.widget_unit;
date_width = (int)BLF_width(style->widgetlabel.uifont_id, date_buf, sizeof(date_buf)) + U.widget_unit;
#endif /* WITH_BUILDINFO */
+ int label_delta2 = 0;
+ int cow_width;
+ char cow_buf[64] = "\0";
+ BLI_snprintf(cow_buf, sizeof(cow_buf), "COW %s", DEG_depsgraph_use_copy_on_write() ? "Enabled!" : "disabled");
+
+ BLF_size(style->widgetlabel.uifont_id, style->widgetlabel.points, U.pixelsize * U.dpi);
+ cow_width = (int)BLF_width(style->widgetlabel.uifont_id, cow_buf, sizeof(cow_buf)) + U.widget_unit;
#ifndef WITH_HEADLESS
if (U.pixelsize == 2) {
@@ -2011,7 +2019,16 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
/* XXX, set internal flag - UI_SELECT */
UI_but_flag_enable(but, 1);
}
+
+ label_delta2 = label_delta + 24;
#endif /* WITH_BUILDINFO */
+
+ but = uiDefBut(
+ block, UI_BTYPE_LABEL, 0, cow_buf,
+ U.pixelsize * 502 - cow_width, U.pixelsize * (267 - label_delta2),
+ cow_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
+ /* XXX, set internal flag - UI_SELECT */
+ UI_but_flag_enable(but, 1);
layout = UI_block_layout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 10, 2, U.pixelsize * 480, U.pixelsize * 110, 0, style);