[wayland] Announce AbstractClient to PlasmaWindowManagement interface

Creates a PlasmaWindowInterface for each AbstractClient and so far
passes caption and virtual desktop through.
icc-effect-5.14.5
Martin Gräßlin 2015-06-16 06:50:22 +02:00
parent 6e58d50efa
commit 0b00af25dc
2 changed files with 21 additions and 0 deletions

View File

@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "wayland_server.h"
#include "client.h"
#include "abstract_backend.h"
#include "composite.h"
#include "screens.h"
@ -197,9 +198,27 @@ void WaylandServer::initWorkspace()
);
}
);
connect(workspace(), &Workspace::clientAdded, this, &WaylandServer::announceClientToWindowManagement);
connect(this, &WaylandServer::shellClientAdded, this, &WaylandServer::announceClientToWindowManagement);
}
}
void WaylandServer::announceClientToWindowManagement(AbstractClient *c)
{
auto w = m_windowManagement->createWindow(c);
w->setTitle(c->caption());
w->setVirtualDesktop(c->isOnAllDesktops() ? 0 : c->desktop() - 1);
connect(c, &AbstractClient::captionChanged, w, [w, c] { w->setTitle(c->caption()); });
connect(c, &AbstractClient::desktopChanged, w,
[w, c] {
if (c->isOnAllDesktops()) {
return;
}
w->setVirtualDesktop(c->desktop() - 1);
}
);
}
void WaylandServer::initOutputs()
{
if (m_backend && m_backend->handlesOutputs()) {

View File

@ -54,6 +54,7 @@ namespace KWin
class ShellClient;
class AbstractBackend;
class AbstractClient;
class KWIN_EXPORT WaylandServer : public QObject
{
@ -137,6 +138,7 @@ Q_SIGNALS:
private:
void fakeDummyQtWindowInput();
quint16 createClientId(KWayland::Server::ClientConnection *c);
void announceClientToWindowManagement(AbstractClient *c);
KWayland::Server::Display *m_display = nullptr;
KWayland::Server::CompositorInterface *m_compositor = nullptr;
KWayland::Server::SeatInterface *m_seat = nullptr;