def winEventFilter(self, message): """ Extend the built-in event filtering to handle the WM_DWMCOMPOSITIONCHANGED message on Windows. """ if getattr(message, 'message', None) == WM_DWMCOMPOSITIONCHANGED: self.compositionChanged.emit() return QApplication.winEventFilter(self, message)