forked from bartvdbraak/blender
add --debug-handlers so --debug-events isnt so noisy.
This commit is contained in:
parent
7413adce04
commit
c9e5b1e6ee
@ -130,8 +130,9 @@ enum {
|
|||||||
G_DEBUG_FFMPEG = (1 << 1),
|
G_DEBUG_FFMPEG = (1 << 1),
|
||||||
G_DEBUG_PYTHON = (1 << 2), /* extra python info */
|
G_DEBUG_PYTHON = (1 << 2), /* extra python info */
|
||||||
G_DEBUG_EVENTS = (1 << 3), /* input/window/screen events */
|
G_DEBUG_EVENTS = (1 << 3), /* input/window/screen events */
|
||||||
G_DEBUG_WM = (1 << 4), /* operator, undo */
|
G_DEBUG_HANDLERS = (1 << 4), /* events handling */
|
||||||
G_DEBUG_JOBS = (1 << 5) /* jobs time profiling */
|
G_DEBUG_WM = (1 << 5), /* operator, undo */
|
||||||
|
G_DEBUG_JOBS = (1 << 6) /* jobs time profiling */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define G_DEBUG_ALL (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS)
|
#define G_DEBUG_ALL (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS)
|
||||||
|
@ -242,6 +242,7 @@ static PyGetSetDef bpy_app_getsets[] = {
|
|||||||
{(char *)"debug_ffmpeg", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FFMPEG},
|
{(char *)"debug_ffmpeg", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FFMPEG},
|
||||||
{(char *)"debug_python", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_PYTHON},
|
{(char *)"debug_python", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_PYTHON},
|
||||||
{(char *)"debug_events", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_EVENTS},
|
{(char *)"debug_events", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_EVENTS},
|
||||||
|
{(char *)"debug_handlers", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_HANDLERS},
|
||||||
{(char *)"debug_wm", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM},
|
{(char *)"debug_wm", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM},
|
||||||
|
|
||||||
{(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL},
|
{(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL},
|
||||||
|
@ -853,7 +853,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
|
|||||||
WM_operator_last_properties_init(op);
|
WM_operator_last_properties_init(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((G.debug & G_DEBUG_EVENTS) && event && event->type != MOUSEMOVE) {
|
if ((G.debug & G_DEBUG_HANDLERS) && event && event->type != MOUSEMOVE) {
|
||||||
printf("%s: handle evt %d win %d op %s\n",
|
printf("%s: handle evt %d win %d op %s\n",
|
||||||
__func__, event ? event->type : 0, CTX_wm_screen(C)->subwinactive, ot->idname);
|
__func__, event ? event->type : 0, CTX_wm_screen(C)->subwinactive, ot->idname);
|
||||||
}
|
}
|
||||||
@ -1680,7 +1680,7 @@ static int wm_action_not_handled(int action)
|
|||||||
static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers)
|
static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers)
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
const int do_debug_handler = (G.debug & G_DEBUG_EVENTS)
|
const int do_debug_handler = (G.debug & G_DEBUG_HANDLERS)
|
||||||
/* comment this out to flood the console! (if you really want to test) */
|
/* comment this out to flood the console! (if you really want to test) */
|
||||||
&& !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)
|
&& !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)
|
||||||
;
|
;
|
||||||
@ -2067,7 +2067,7 @@ void wm_event_do_handlers(bContext *C)
|
|||||||
while ( (event = win->queue.first) ) {
|
while ( (event = win->queue.first) ) {
|
||||||
int action = WM_HANDLER_CONTINUE;
|
int action = WM_HANDLER_CONTINUE;
|
||||||
|
|
||||||
if ((G.debug & G_DEBUG_EVENTS) && event && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
|
if ((G.debug & G_DEBUG_HANDLERS) && event && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
|
||||||
printf("%s: pass on evt %d val %d\n", __func__, event->type, event->val);
|
printf("%s: pass on evt %d val %d\n", __func__, event->type, event->val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1128,6 +1128,7 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
|
|||||||
#endif
|
#endif
|
||||||
BLI_argsAdd(ba, 1, NULL, "--debug-python", "\n\tEnable debug messages for python", debug_mode_generic, (void *)G_DEBUG_PYTHON);
|
BLI_argsAdd(ba, 1, NULL, "--debug-python", "\n\tEnable debug messages for python", debug_mode_generic, (void *)G_DEBUG_PYTHON);
|
||||||
BLI_argsAdd(ba, 1, NULL, "--debug-events", "\n\tEnable debug messages for the event system", debug_mode_generic, (void *)G_DEBUG_EVENTS);
|
BLI_argsAdd(ba, 1, NULL, "--debug-events", "\n\tEnable debug messages for the event system", debug_mode_generic, (void *)G_DEBUG_EVENTS);
|
||||||
|
BLI_argsAdd(ba, 1, NULL, "--debug-handlers", "\n\tEnable debug messages for event handling", debug_mode_generic, (void *)G_DEBUG_HANDLERS);
|
||||||
BLI_argsAdd(ba, 1, NULL, "--debug-wm", "\n\tEnable debug messages for the window manager", debug_mode_generic, (void *)G_DEBUG_WM);
|
BLI_argsAdd(ba, 1, NULL, "--debug-wm", "\n\tEnable debug messages for the window manager", debug_mode_generic, (void *)G_DEBUG_WM);
|
||||||
BLI_argsAdd(ba, 1, NULL, "--debug-all", "\n\tEnable all debug messages (excludes libmv)", debug_mode_generic, (void *)G_DEBUG_ALL);
|
BLI_argsAdd(ba, 1, NULL, "--debug-all", "\n\tEnable all debug messages (excludes libmv)", debug_mode_generic, (void *)G_DEBUG_ALL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user