Commit 4ac4a97c authored by Martin Flöser's avatar Martin Flöser

Implement AbstractClient::tabBoxClient

Moves the implementation from Client to AbstractClient.
parent ab4e7988
......@@ -18,12 +18,18 @@ 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 "abstract_client.h"
#ifdef KWIN_BUILD_TABBOX
#include "tabbox.h"
#endif
namespace KWin
{
AbstractClient::AbstractClient()
: Toplevel()
#ifdef KWIN_BUILD_TABBOX
, m_tabBoxClient(QSharedPointer<TabBox::TabBoxClientImpl>(new TabBox::TabBoxClientImpl(this)))
#endif
{
}
......
......@@ -45,7 +45,10 @@ class AbstractClient : public Toplevel
public:
virtual ~AbstractClient();
virtual QWeakPointer<TabBox::TabBoxClientImpl> tabBoxClient() const = 0;
QWeakPointer<TabBox::TabBoxClientImpl> tabBoxClient() const {
return m_tabBoxClient.toWeakRef();
}
virtual void updateMouseGrab();
virtual QString caption(bool full = true, bool stripped = false) const = 0;
virtual bool isMinimized() const = 0;
......@@ -164,6 +167,9 @@ protected:
AbstractClient();
// TODO: remove boolean trap
virtual bool belongsToSameApplication(const AbstractClient *other, bool active_hack) const = 0;
private:
QSharedPointer<TabBox::TabBoxClientImpl> m_tabBoxClient;
};
}
......
......@@ -32,9 +32,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "focuschain.h"
#include "group.h"
#include "shadow.h"
#ifdef KWIN_BUILD_TABBOX
#include "tabbox.h"
#endif
#include "workspace.h"
#include "screenedge.h"
#include "decorations/decorationbridge.h"
......@@ -185,11 +182,6 @@ Client::Client()
//Client to workspace connections require that each
//client constructed be connected to the workspace wrapper
#ifdef KWIN_BUILD_TABBOX
// TabBoxClient
m_tabBoxClient = QSharedPointer<TabBox::TabBoxClientImpl>(new TabBox::TabBoxClientImpl(this));
#endif
geom = QRect(0, 0, 100, 100); // So that decorations don't start with size being (0,0)
client_size = QSize(100, 100);
ready_for_painting = false; // wait for first damage or sync reply
......
......@@ -607,9 +607,6 @@ public:
void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom) const;
QWeakPointer<TabBox::TabBoxClientImpl> tabBoxClient() const override {
return m_tabBoxClient.toWeakRef();
}
bool isFirstInTabBox() const override {
return m_firstInTabBox;
}
......@@ -972,7 +969,6 @@ private:
int sm_stacking_order;
friend struct ResetupRulesProcedure;
friend class GeometryUpdatesBlocker;
QSharedPointer<TabBox::TabBoxClientImpl> m_tabBoxClient;
bool m_firstInTabBox;
bool electricMaximizing;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment