Skip to content

Commit

Permalink
fix: dock became normal window
Browse files Browse the repository at this point in the history
not set window flag

log: as title
  • Loading branch information
tsic404 committed Mar 29, 2024
1 parent 19e0670 commit 86d0eb3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
4 changes: 0 additions & 4 deletions frame/layershell/x11dlayershellemulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ LayerShellEmulation::LayerShellEmulation(QWindow* window, QObject *parent)
, m_window(window)
, m_dlayerShellWindow(DLayerShellWindow::get(m_window))
{
m_window->setFlag(Qt::FramelessWindowHint);
onLayerChanged();
connect(m_dlayerShellWindow, &DLayerShellWindow::layerChanged, this, &LayerShellEmulation::onLayerChanged);

Expand Down Expand Up @@ -59,7 +58,6 @@ void LayerShellEmulation::onLayerChanged()
auto xcbWindow = dynamic_cast<QNativeInterface::Private::QXcbWindow*>(m_window->handle());
switch (m_dlayerShellWindow->layer()) {
case DLayerShellWindow::LayerBackground: {
m_window->setFlags(m_window->flags() & ~Qt::WindowStaysOnBottomHint);
xcbWindow->setWindowType(QNativeInterface::Private::QXcbWindow::Desktop);
break;
}
Expand All @@ -70,15 +68,13 @@ void LayerShellEmulation::onLayerChanged()
break;
}
case DLayerShellWindow::LayerTop: {
m_window->setFlags(m_window->flags() & ~Qt::WindowStaysOnBottomHint);
xcbWindow->setWindowType(QNativeInterface::Private::QXcbWindow::Dock);
break;
}
case DLayerShellWindow::LayerOverlay: {
// on deepin Notification will be influenced by exclusionZone,
// while plasma works all right, maybe deepin kwin bug?
// FIXME: fix above
m_window->setFlags(m_window->flags() & ~Qt::WindowStaysOnBottomHint);
xcbWindow->setWindowType(QNativeInterface::Private::QXcbWindow::Notification);
break;
}
Expand Down
18 changes: 16 additions & 2 deletions shell/appletloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
#include <QMap>
#include <QLoggingCategory>
#include <QElapsedTimer>
#include <DWindowManagerHelper>

DS_BEGIN_NAMESPACE
DCORE_USE_NAMESPACE;
DGUI_USE_NAMESPACE

Q_LOGGING_CATEGORY(dsLoaderLog, "dde.shell.loader")

Expand Down Expand Up @@ -126,8 +128,20 @@ void DAppletLoaderPrivate::doCreateRootObject(DApplet *applet)
Q_EMIT q->failed();
}
});
if (!engine->create()) {
engine->deleteLater();

// FIXME: kwin load slowly make blur or other effets not ready, should in dtk to ensure effects loaded
if (DWindowManagerHelper::instance()->hasNoTitlebar()) {
if (!engine->create()) {
engine->deleteLater();
}
} else {
QObject::connect(DWindowManagerHelper::instance(), &DWindowManagerHelper::hasNoTitlebarChanged, applet, [engine, applet] () {
if (DWindowManagerHelper::instance()->hasNoTitlebar()) {
if (!engine->create()) {
engine->deleteLater();
}
}
});
}
}

Expand Down
17 changes: 16 additions & 1 deletion shell/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include <csignal>
#include <iostream>
#include <qnamespace.h>
#include <qobjectdefs.h>

#include "applet.h"
#include "containment.h"
Expand Down Expand Up @@ -146,8 +148,21 @@ int main(int argc, char *argv[])
DPluginLoader::instance()->setDisabledApplets(disabledApplets);
}

qCInfo(dsLog) << "Loading plugin id" << pluginIds;
for (const auto &pluginId : pluginIds) {
auto applet = DPluginLoader::instance()->loadApplet(DAppletData{pluginId});
if (!applet) {
qCWarning(dsLog) << "Loading plugin failed:" << pluginId;
continue;
}
applets << applet;
}

AppletManager manager(pluginIds);
manager.exec();

QMetaObject::invokeMethod(&a, [&manager](){
manager.exec();
}, Qt::QueuedConnection);

QObject::connect(qApp, &QCoreApplication::aboutToQuit, qApp, [&manager]() {
qCInfo(dsLog) << "Exit dde-shell.";
Expand Down

0 comments on commit 86d0eb3

Please sign in to comment.