diff --git a/src/widgets/dplatformwindowhandle.cpp b/src/widgets/dplatformwindowhandle.cpp index 77fb3d1b7..e5d19b6a7 100644 --- a/src/widgets/dplatformwindowhandle.cpp +++ b/src/widgets/dplatformwindowhandle.cpp @@ -29,6 +29,7 @@ DWIDGET_BEGIN_NAMESPACE #define DEFINE_CONST_CHAR(Name) const char _##Name[] = "_d_" #Name DEFINE_CONST_CHAR(useDxcb); +DEFINE_CONST_CHAR(redirectContent); DEFINE_CONST_CHAR(netWmStates); DEFINE_CONST_CHAR(windowRadius); DEFINE_CONST_CHAR(borderWidth); @@ -158,6 +159,24 @@ void DPlatformWindowHandle::enableDXcbForWindow(QWindow *window) } } +void DPlatformWindowHandle::enableDXcbForWindow(QWidget *widget, bool redirectContent) +{ + enableDXcbForWindow(widget); + + if (isEnabledDXcb(widget)) { + widget->windowHandle()->setProperty(_redirectContent, redirectContent); + } +} + +void DPlatformWindowHandle::enableDXcbForWindow(QWindow *window, bool redirectContent) +{ + enableDXcbForWindow(window); + + if (isEnabledDXcb(window)) { + window->setProperty(_redirectContent, redirectContent); + } +} + bool DPlatformWindowHandle::isEnabledDXcb(const QWidget *widget) { return widget->windowHandle() && widget->windowHandle()->property(_useDxcb).toBool(); diff --git a/src/widgets/dplatformwindowhandle.h b/src/widgets/dplatformwindowhandle.h index 4d43010af..d3ef4fe92 100644 --- a/src/widgets/dplatformwindowhandle.h +++ b/src/widgets/dplatformwindowhandle.h @@ -62,6 +62,8 @@ class DPlatformWindowHandle : public QObject static void enableDXcbForWindow(QWidget *widget); static void enableDXcbForWindow(QWindow *window); + static void enableDXcbForWindow(QWidget *widget, bool redirectContent); + static void enableDXcbForWindow(QWindow *window, bool redirectContent); static bool isEnabledDXcb(const QWidget *widget); static bool isEnabledDXcb(const QWindow *window);