logind: Add a function that detects the logind seat.

Summary:
This will allow other parts of kwin to get the current logind seat that this instance is running under

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, anthonyfieroni, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9551
This commit is contained in:
Nerdopolis Turfwalker 2018-01-05 22:45:28 +01:00 committed by Albert Astals Cid
parent 913d6cca47
commit f6e93aedb2
2 changed files with 8 additions and 0 deletions

View file

@ -438,6 +438,9 @@ void LogindIntegration::getSeat()
if (m_seatPath != seatPath) {
m_seatPath = seatPath;
}
if (m_seatName != seat.name) {
m_seatName = seat.name;
}
}
);
}

View file

@ -56,6 +56,10 @@ public:
int takeDevice(const char *path);
void releaseDevice(int fd);
const QString seat() const {
return m_seatName;
}
Q_SIGNALS:
void connectedChanged();
void hasSessionControlChanged(bool);
@ -91,6 +95,7 @@ private:
bool m_sessionControl;
bool m_sessionActive;
int m_vt = -1;
QString m_seatName = QStringLiteral("seat0");
QString m_seatPath;
QString m_sessionControllerName;
QString m_sessionControllerService;