xfwm4 crashes with BadDrawable

This started happening, when I added the telegram plugin to my Pidgin instant-messenger. Now, when flip through the messenger's tabs, the entire window manager sometimes crashes:

(xfwm4:55741): Gdk-ERROR **: 11:36:18.825: The program 'xfwm4' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
  (Details: serial 76283839 error_code 9 request_code 14 (core protocol) minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Thоugh the WM is automatically restarted, certain clients (like wfica) remain messed up and need to be restarted too.

Unfortunately, the debugging advice above seems stale:

(gdb) b gdk_x_error
Function "gdk_x_error" not defined.
Edited by UnitedMarsupials