Reimplement QWidget::x11Event(XEvent*) and catch it there.

Regards