Skip to content

Commit

Permalink
sync: from linuxdeepin/dtkgui
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/dtkgui.

Source-pull-request: linuxdeepin/dtkgui#254
  • Loading branch information
deepin-ci-robot authored and 18202781743 committed Aug 30, 2024
1 parent 11b5690 commit 098486f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/kernel/dplatformhandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ static void setWindowProperty(QWindow *window, const char *name, const QVariant
reinterpret_cast<void(*)(QWindow *, const char *, const QVariant &)>(setWindowProperty)(window, name, value);
}

static bool isTreeLand()
{
return qEnvironmentVariable("DDE_CURRENT_COMPOSITOR") == "TreeLand";
};

/*!
\class Dtk::Gui::DPlatformHandle
\inmodule dtkgui
Expand Down Expand Up @@ -623,7 +628,7 @@ class Q_DECL_HIDDEN CreatorWindowEventFile : public QObject {
}
}

if (auto *w = qobject_cast<QWindow *>(watched)) {
if (auto *w = qobject_cast<QWindow *>(watched); w && isTreeLand()) {
if(DContextShellWindow *window = DContextShellWindow::get(qobject_cast<QWindow *>(watched))) {
bool is_mouse_move = event->type() == QEvent::MouseMove && static_cast<QMouseEvent*>(event)->buttons() == Qt::LeftButton;

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 098486f

Please sign in to comment.