Make Outline a KWIN_SINGLETON

Given that Outline is now a QObject hold by Workspace, but not used in
Workspace, it can also be a KWIN_SINGLETON.

REVIEW: 110146
master
Martin Gräßlin 12 years ago
parent 1a3bc3f60c
commit cd025c7526

@ -2629,7 +2629,7 @@ void Client::finishMoveResize(bool cancel)
if (isElectricBorderMaximizing()) {
setQuickTileMode(electricMode);
electricMaximizing = false;
workspace()->outline()->hide();
outline()->hide();
} else if (!cancel) {
if (!(maximizeMode() & MaximizeHorizontal)) {
geom_restore.setX(geometry().x());
@ -3088,9 +3088,9 @@ void Client::setElectricBorderMaximizing(bool maximizing)
{
electricMaximizing = maximizing;
if (maximizing)
workspace()->outline()->show(electricBorderMaximizeGeometry(cursorPos(), desktop()));
outline()->show(electricBorderMaximizeGeometry(cursorPos(), desktop()));
else
workspace()->outline()->hide();
outline()->hide();
}
QRect Client::electricBorderMaximizeGeometry(QPoint pos, int desktop)

@ -33,6 +33,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace KWin {
KWIN_SINGLETON_FACTORY(Outline)
Outline::Outline(QObject *parent)
: QObject(parent)
, m_active(false)

@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef KWIN_OUTLINE_H
#define KWIN_OUTLINE_H
#include "xcbutils.h"
#include <kwinglobals.h>
#include <QRect>
namespace Plasma {
@ -44,7 +45,6 @@ class OutlineVisual;
class Outline : public QObject {
Q_OBJECT
public:
Outline(QObject *parent);
~Outline();
/**
@ -87,6 +87,7 @@ private:
QScopedPointer<OutlineVisual> m_visual;
QRect m_outlineGeometry;
bool m_active;
KWIN_SINGLETON(Outline)
};
class OutlineVisual
@ -163,6 +164,12 @@ void NonCompositedOutlineVisual::forEachWindow(T method)
(m_leftOutline.*method)();
}
inline
Outline *outline()
{
return Outline::self();
}
}
#endif

@ -242,17 +242,17 @@ void WorkspaceWrapper::setupClientConnections(KWin::Client *client)
void WorkspaceWrapper::showOutline(const QRect &geometry)
{
Workspace::self()->outline()->show(geometry);
outline()->show(geometry);
}
void WorkspaceWrapper::showOutline(int x, int y, int width, int height)
{
Workspace::self()->outline()->show(QRect(x, y, width, height));
outline()->show(QRect(x, y, width, height));
}
void WorkspaceWrapper::hideOutline()
{
Workspace::self()->outline()->hide();
outline()->hide();
}
Client *WorkspaceWrapper::getClient(qulonglong windowId)

@ -231,7 +231,7 @@ Workspace::Workspace(bool restore)
client_keys = new KActionCollection(this);
m_outline = new Outline(this);
Outline::create(this);
initShortcuts();
@ -1530,11 +1530,6 @@ void Workspace::slotBlockShortcuts(int data)
(*it)->updateMouseGrab();
}
Outline* Workspace::outline()
{
return m_outline;
}
QString Workspace::supportInformation() const
{
QString support;

@ -56,7 +56,6 @@ namespace KWin
class Client;
class KillWindow;
class Outline;
class RootInfo;
class Rules;
class UserActionsMenu;
@ -172,8 +171,6 @@ public:
return deleted;
}
Outline* outline();
#ifdef KWIN_BUILD_SCREENEDGES
void stackScreenEdgesUnderOverrideRedirect();
#endif
@ -182,7 +179,6 @@ public:
QPoint cascadeOffset(const Client *c) const;
private:
Outline* m_outline;
Compositor *m_compositor;
//-------------------------------------------------

Loading…
Cancel
Save