From aa1ab5ad141b7ae3a2abf5d1dd69564038ed2f68 Mon Sep 17 00:00:00 2001 From: zccrs Date: Mon, 21 Jan 2019 14:31:06 +0800 Subject: [PATCH] feat: add groupLeaderId/clientLeaderId interfaces for DWindowGroupLeader Change-Id: I7f3aae91321cb3beda27f734047bfff7c4afe89e --- src/widgets/dwindowgroupleader.cpp | 16 ++++++++++++++++ src/widgets/dwindowgroupleader.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/src/widgets/dwindowgroupleader.cpp b/src/widgets/dwindowgroupleader.cpp index 7479a014a..d05646524 100644 --- a/src/widgets/dwindowgroupleader.cpp +++ b/src/widgets/dwindowgroupleader.cpp @@ -107,6 +107,22 @@ DWindowGroupLeader::~DWindowGroupLeader() } } +quint32 DWindowGroupLeader::groupLeaderId() const +{ + Q_D(const DWindowGroupLeader); + + const_cast(d)->ensureGroupLeader(); + + return d->groupLeader; +} + +quint32 DWindowGroupLeader::clientLeaderId() const +{ + Q_D(const DWindowGroupLeader); + + return d->clientLeader; +} + void DWindowGroupLeader::addWindow(QWindow *window) { Q_ASSERT(window); diff --git a/src/widgets/dwindowgroupleader.h b/src/widgets/dwindowgroupleader.h index 05f6b2f3a..470fb3dcd 100644 --- a/src/widgets/dwindowgroupleader.h +++ b/src/widgets/dwindowgroupleader.h @@ -36,6 +36,9 @@ class DWindowGroupLeader explicit DWindowGroupLeader(quint32 groupId = 0); ~DWindowGroupLeader(); + quint32 groupLeaderId() const; + quint32 clientLeaderId() const; + void addWindow(QWindow *window); void removeWindow(QWindow *window); void addWindow(QWidget *window);