diff --git a/src/kernel/dplatformhandle.cpp b/src/kernel/dplatformhandle.cpp index 446d36b0..280a929f 100644 --- a/src/kernel/dplatformhandle.cpp +++ b/src/kernel/dplatformhandle.cpp @@ -97,6 +97,11 @@ static void setWindowProperty(QWindow *window, const char *name, const QVariant reinterpret_cast(setWindowProperty)(window, name, value); } +static bool isTreeLand() +{ + return qEnvironmentVariable("DDE_CURRENT_COMPOSITOR") == "TreeLand"; +}; + /*! \class Dtk::Gui::DPlatformHandle \inmodule dtkgui @@ -623,7 +628,7 @@ class Q_DECL_HIDDEN CreatorWindowEventFile : public QObject { } } - if (auto *w = qobject_cast(watched)) { + if (auto *w = qobject_cast(watched); w && isTreeLand()) { if(DContextShellWindow *window = DContextShellWindow::get(qobject_cast(watched))) { bool is_mouse_move = event->type() == QEvent::MouseMove && static_cast(event)->buttons() == Qt::LeftButton; @@ -674,9 +679,6 @@ bool DPlatformHandle::setEnabledNoTitlebarForWindow(QWindow *window, bool enable auto isDWaylandPlatform = [] { return qApp->platformName() == "dwayland" || qApp->property("_d_isDwayland").toBool(); }; - auto isTreeLand = [] { - return qEnvironmentVariable("DDE_CURRENT_COMPOSITOR") == "TreeLand"; - }; if (!(isDXcbPlatform() || isDWaylandPlatform() || isTreeLand())) return false;