[Bf-blender-cvs] [3dedefaedf1] tmp-debug-filebrowser: Debug prints to debug 2.8 filebrowser bug not always working with previews
Dalai Felinto
noreply at git.blender.org
Wed Jul 19 16:39:01 CEST 2017
Commit: 3dedefaedf1f63bc93fd67295c8ecebe00c2afd8
Author: Dalai Felinto
Date: Wed Jul 19 16:37:27 2017 +0200
Branches: tmp-debug-filebrowser
https://developer.blender.org/rB3dedefaedf1f63bc93fd67295c8ecebe00c2afd8
Debug prints to debug 2.8 filebrowser bug not always working with previews
===================================================================
M source/blender/editors/space_file/file_ops.c
M source/blender/windowmanager/intern/wm_event_system.c
===================================================================
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index b7228f634bf..d624558217b 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -1414,6 +1414,7 @@ int file_exec(bContext *C, wmOperator *exec_op)
BLI_make_file_string(G.main->name, filepath, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL),
BLENDER_BOOKMARK_FILE);
fsmenu_write_file(ED_fsmenu_get(), filepath);
+ printf("Fileexec data conversion done, sent event\n");
WM_event_fileselect_event(wm, op, EVT_FILESELECT_EXEC);
}
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 32f978ae891..0be4b2e7feb 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1801,6 +1801,9 @@ static int wm_handler_fileselect_do(bContext *C, ListBase *handlers, wmEventHand
SpaceFile *sfile;
int action = WM_HANDLER_CONTINUE;
+ printf("Starting WM fileselect_do.\n");
+
+
switch (val) {
case EVT_FILESELECT_FULL_OPEN:
{
@@ -1876,7 +1879,9 @@ static int wm_handler_fileselect_do(bContext *C, ListBase *handlers, wmEventHand
if (handler->op->type->flag & OPTYPE_UNDO)
wm->op_undo_depth++;
+ printf("About to execute file operator... ");
retval = handler->op->type->exec(C, handler->op);
+ printf("DONE\n");
/* XXX check this carefully, CTX_wm_manager(C) == wm is a bit hackish */
if (handler->op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
@@ -1957,6 +1962,8 @@ static int wm_handler_fileselect_do(bContext *C, ListBase *handlers, wmEventHand
static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHandler *handler, const wmEvent *event)
{
int action = WM_HANDLER_CONTINUE;
+
+ printf("%s: %d (%d, %p)\n", __func__, handler->op == (wmOperator *)event->customdata, event->type, event->customdata);
if (event->type != EVT_FILESELECT)
return action;
@@ -2010,6 +2017,8 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
int action = WM_HANDLER_CONTINUE;
int always_pass;
+ printf("%s: %d, %p (%p)\n", __func__, event->type, event->customdata, handlers);
+
if (handlers == NULL) {
return action;
}
@@ -2026,9 +2035,13 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
/* during this loop, ui handlers for nested menus can tag multiple handlers free */
if (handler->flag & WM_HANDLER_DO_FREE) {
+ printf("%s: tobefreed handler, skiping %d, %p\n", __func__, event->type, event->customdata);
/* pass */
}
else if (handler_boundbox_test(handler, event)) { /* optional boundbox */
+ if (handler->type == WM_HANDLER_FILESELECT)
+ printf("%s: checking %d, %p\n", __func__, event->type, event->customdata);
+
/* in advance to avoid access to freed event on window close */
always_pass = wm_event_always_pass(event);
@@ -2037,6 +2050,7 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
action |= WM_HANDLER_BREAK;
if (handler->keymap) {
+ printf("%s: handler keymap stuff, %d, %p\n", __func__, event->type, event->customdata);
wmKeyMap *keymap = WM_keymap_active(wm, handler->keymap);
wmKeyMapItem *kmi;
@@ -2081,11 +2095,13 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
}
else if (handler->ui_handle) {
if (!wm->is_interface_locked) {
+ printf("%s: ui_handler stuff, %d, %p\n", __func__, event->type, event->customdata);
action |= wm_handler_ui_call(C, handler, event, always_pass);
}
}
else if (handler->type == WM_HANDLER_FILESELECT) {
if (!wm->is_interface_locked) {
+ printf("%s: filehandler select stuff, %d, %p\n", __func__, event->type, event->customdata);
/* screen context changes here */
action |= wm_handler_fileselect_call(C, handlers, handler, event);
}
@@ -2579,6 +2595,7 @@ void WM_event_fileselect_event(wmWindowManager *wm, void *ophandle, int eventval
for (win = wm->windows.first; win; win = win->next) {
wmEvent event = *win->eventstate;
+ printf("%s: Adding fileselect event to window %p (%d, %p)\n", __func__, win, eventval, ophandle);
event.type = EVT_FILESELECT;
event.val = eventval;
More information about the Bf-blender-cvs
mailing list