Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions misc/dbus/org.deepin.compositor1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
</method>
<signal name="SessionChanged">
</signal>
<signal name="XWaylandAuthChanged">
</signal>
</interface>
</node>
2 changes: 2 additions & 0 deletions src/core/treeland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ class Compositor1Adaptor: public QDBusAbstractAdaptor
" <arg direction=\"out\" type=\"ay\" name=\"auth\"/>\n"
" </method>\n"
" <signal name=\"SessionChanged\"/>\n"
" <signal name=\"XWaylandAuthChanged\"/>\n"
" </interface>\n"
"")
public:
Expand All @@ -396,6 +397,7 @@ public Q_SLOTS: // METHODS

Q_SIGNALS: // SIGNALS
void SessionChanged();
void XWaylandAuthChanged();
};

Treeland::Treeland()
Expand Down
1 change: 1 addition & 0 deletions src/core/treeland.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@
Q_SIGNALS:
void socketDisconnected();
void SessionChanged();
void XWaylandAuthChanged();

public Q_SLOTS:

Check warning on line 49 in src/core/treeland.h

View workflow job for this annotation

GitHub Actions / cppcheck

There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it.
bool ActivateWayland(QDBusUnixFileDescriptor fd);
void XWaylandName();

Expand Down
4 changes: 4 additions & 0 deletions src/seat/helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1968,6 +1968,10 @@ void Helper::init(Treeland::Treeland *treeland)
{
m_treeland = treeland;
connect(m_sessionManager, &SessionManager::sessionChanged, treeland, &Treeland::Treeland::SessionChanged);
connect(m_sessionManager,
&SessionManager::xwaylandAuthChanged,
treeland,
&Treeland::Treeland::XWaylandAuthChanged);

auto engine = qmlEngine();
m_greeterProxy = engine->singletonInstance<GreeterProxy *>("Treeland", "GreeterProxy");
Expand Down
1 change: 1 addition & 0 deletions src/session/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ std::shared_ptr<Session> SessionManager::ensureSession(int id, QString username)
xwayland->setOwnsSocket(socket);
// Connect signals
connect(xwayland, &WXWayland::ready, this, [this, xwayland] {
Q_EMIT xwaylandAuthChanged();
syncActiveSessionXWaylandPrimaryOutput();
if (auto session = sessionForXWayland(xwayland)) {
session->m_noTitlebarAtom =
Expand Down
1 change: 1 addition & 0 deletions src/session/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class SessionManager : public QObject {
Q_SIGNALS:
void socketFileChanged();
void sessionChanged();
void xwaylandAuthChanged();

private:
std::shared_ptr<Session> ensureSession(int id, QString username);
Expand Down
16 changes: 9 additions & 7 deletions src/systemd-socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ class SocketActivator : public QObject
if (!test.isValid())
return false;

if (m_type == "xwayland") {
m_compositorBus = busFromConnection(connection);
return true;
}

return connectActivationSignal(connection);
}

Expand Down Expand Up @@ -264,12 +259,19 @@ public Q_SLOTS:
if (m_compositorBus == bus)
return true;

// Xwayland only has to react to auth refreshes. Its display number and
// the XAUTHORITY path survive a wlroots in-place Xwayland restart, so
// a session change does not affect it and must not re-run activation.
const QString signalName = m_type == "xwayland"
? QStringLiteral("XWaylandAuthChanged")
: QStringLiteral("SessionChanged");

if (m_compositorBus.has_value()) {
auto oldConnection = dbusConnection(*m_compositorBus);
oldConnection.disconnect("org.deepin.Compositor1",
"/org/deepin/Compositor1",
"org.deepin.Compositor1",
QStringLiteral("SessionChanged"),
signalName,
this,
SLOT(activate()));
m_compositorBus.reset();
Expand All @@ -278,7 +280,7 @@ public Q_SLOTS:
if (connection.connect("org.deepin.Compositor1",
"/org/deepin/Compositor1",
"org.deepin.Compositor1",
QStringLiteral("SessionChanged"),
signalName,
this,
SLOT(activate()))) {
m_compositorBus = bus;
Expand Down
Loading