diff --git a/debian/gxde-ai-see.substvars b/debian/gxde-ai-see.substvars new file mode 100644 index 0000000..910ebe4 --- /dev/null +++ b/debian/gxde-ai-see.substvars @@ -0,0 +1,3 @@ +shlibs:Depends=libc6 (>= 2.34), libdtk2widget6 (>= 6:6.3.8), libdtk6core (>= 6.0.48), libgcc-s1 (>= 3.0), libicu76 (>= 76.1-1~), liblayershellqtinterface6 (>= 6.1.0), libqt6core6t64 (>= 6.8.2), libqt6dbus6 (>= 6.1.2), libqt6gui6 (>= 6.1.2), libqt6network6 (>= 6.1.2), libqt6widgets6 (>= 6.3.0), libstdc++6 (>= 5) +misc:Depends= +misc:Pre-Depends= diff --git a/src/app.cpp b/src/app.cpp index dc14e18..b234078 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -11,6 +11,8 @@ #include "todo/todowindow.h" #include "ui/portalpanel.h" +#include +#include #include #include #include @@ -60,6 +62,26 @@ bool App::init(bool daemon, bool forceShow, bool showTodo, bool showChat) m_model = new StagingModel(this); + /* gxde-k9 keeps restarting us; when the compositor has no portal support we + * warn once and then stay idle instead of exiting (which would make k9 + * relaunch us every few seconds). */ + if (daemon && !PortalClient::instance()->available() && + !Config::instance()->getBool(QStringLiteral("warned/unsupportedEnv"), false)) { + QDBusMessage notification = QDBusMessage::createMethodCall( + QStringLiteral("org.freedesktop.Notifications"), + QStringLiteral("/org/freedesktop/Notifications"), + QStringLiteral("org.freedesktop.Notifications"), QStringLiteral("Notify")); + notification << QStringLiteral("gxde-ai-see") << 0u + << QStringLiteral("gxde-ai-see") + << tr("小埃同学") + << tr("当前桌面不支持传送门(需要 GXDE Wayland 合成器)。" + "小埃同学会继续在后台待命,暂存区、内容工厂和对话仍然可用。") + << QStringList() << QVariantMap() << 6000; + QDBusConnection::sessionBus().send(notification); + Config::instance()->set(QStringLiteral("warned/unsupportedEnv"), true); + Config::instance()->sync(); + } + PortalClient *portal = PortalClient::instance(); connect(portal, &PortalClient::dragStarted, this, [this](const QString &mimeTypes) { if (!PortalClient::mimeInteresting(mimeTypes)) {