X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcsignals.C;h=779d7e40922ff8919bc2e190ce2dea1fee967f20;hb=f5725c7e12def18fec49a295dad688652edaa4b3;hp=ffc8a1c156d4062adb38c80846620cb2f9e00080;hpb=9e3d90a964c0fbe97c0b58235336a47111932d5d;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/bcsignals.C b/cinelerra-5.1/guicast/bcsignals.C index ffc8a1c1..779d7e40 100644 --- a/cinelerra-5.1/guicast/bcsignals.C +++ b/cinelerra-5.1/guicast/bcsignals.C @@ -313,6 +313,8 @@ BC_Signals::~BC_Signals() } +int dump_xerror = -1; + int BC_Signals::x_error_handler(Display *display, XErrorEvent *event) { char string[1024]; @@ -320,6 +322,12 @@ int BC_Signals::x_error_handler(Display *display, XErrorEvent *event) fprintf(stderr, "BC_Signals::x_error_handler: error_code=%d opcode=%d,%d id=0x%jx %s\n", event->error_code, event->request_code, event->minor_code, (int64_t)event->resourceid, string); + if( dump_xerror < 0 ) { + char *env = getenv("BC_TRACE_XERROR"); + dump_xerror = !env || !atoi(env) ? 0 : 1; + } + if( dump_xerror ) + dump_stack(); return 0; }