NumberDesktopsChanged becomes a signal
TODO: connect DesktopChangeOSD also to the signalicc-effect-5.14.5
parent
15757e953a
commit
747afb4225
|
@ -102,6 +102,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(CompositingType type)
|
|||
connect(ws, SIGNAL(unmanagedAdded(KWin::Unmanaged*)), this, SLOT(slotUnmanagedAdded(KWin::Unmanaged*)));
|
||||
connect(ws, SIGNAL(clientActivated(KWin::Client*)), this, SLOT(slotClientActivated(KWin::Client*)));
|
||||
connect(ws, SIGNAL(deletedRemoved(KWin::Deleted*)), this, SLOT(slotDeletedRemoved(KWin::Deleted*)));
|
||||
connect(ws, SIGNAL(numberDesktopsChanged(int)), SIGNAL(numberDesktopsChanged(int)));
|
||||
connect(ws->tabBox(), SIGNAL(tabBoxAdded(int)), SIGNAL(tabBoxAdded(int)));
|
||||
connect(ws->tabBox(), SIGNAL(tabBoxUpdated()), SIGNAL(tabBoxUpdated()));
|
||||
connect(ws->tabBox(), SIGNAL(tabBoxClosed()), SIGNAL(tabBoxClosed()));
|
||||
|
@ -497,12 +498,6 @@ void EffectsHandlerImpl::propertyNotify(EffectWindow* c, long atom)
|
|||
ep.second->propertyNotify(c, atom);
|
||||
}
|
||||
|
||||
void EffectsHandlerImpl::numberDesktopsChanged(int old)
|
||||
{
|
||||
foreach (const EffectPair & ep, loaded_effects)
|
||||
ep.second->numberDesktopsChanged(old);
|
||||
}
|
||||
|
||||
void EffectsHandlerImpl::registerPropertyType(long atom, bool reg)
|
||||
{
|
||||
if (reg)
|
||||
|
|
|
@ -171,7 +171,6 @@ public:
|
|||
void grabbedKeyboardEvent(QKeyEvent* e);
|
||||
bool hasKeyboardGrab() const;
|
||||
void propertyNotify(EffectWindow* c, long atom);
|
||||
void numberDesktopsChanged(int old);
|
||||
|
||||
bool loadEffect(const QString& name);
|
||||
void toggleEffect(const QString& name);
|
||||
|
|
|
@ -76,6 +76,7 @@ DesktopGridEffect::DesktopGridEffect()
|
|||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
|
||||
connect(effects, SIGNAL(windowDeleted(EffectWindow*)), this, SLOT(slotWindowDeleted(EffectWindow*)));
|
||||
connect(effects, SIGNAL(numberDesktopsChanged(int)), this, SLOT(slotNumberDesktopsChanged(int)));
|
||||
|
||||
// Load all other configuration details
|
||||
reconfigure(ReconfigureAll);
|
||||
|
@ -1259,7 +1260,7 @@ void DesktopGridEffect::slotRemoveDesktop()
|
|||
effects->setNumberOfDesktops(effects->numberOfDesktops() - 1);
|
||||
}
|
||||
|
||||
void DesktopGridEffect::numberDesktopsChanged(int old)
|
||||
void DesktopGridEffect::slotNumberDesktopsChanged(int old)
|
||||
{
|
||||
if (!activated)
|
||||
return;
|
||||
|
|
|
@ -75,7 +75,6 @@ public:
|
|||
virtual void windowInputMouseEvent(Window w, QEvent* e);
|
||||
virtual void grabbedKeyboardEvent(QKeyEvent* e);
|
||||
virtual bool borderActivated(ElectricBorder border);
|
||||
virtual void numberDesktopsChanged(int old);
|
||||
|
||||
enum { LayoutPager, LayoutAutomatic, LayoutCustom }; // Layout modes
|
||||
|
||||
|
@ -89,6 +88,7 @@ private slots:
|
|||
void slotWindowAdded(EffectWindow* w);
|
||||
void slotWindowClosed(EffectWindow *w);
|
||||
void slotWindowDeleted(EffectWindow *w);
|
||||
void slotNumberDesktopsChanged(int old);
|
||||
|
||||
private:
|
||||
QPointF scalePos(const QPoint& pos, int desktop, int screen = -1) const;
|
||||
|
|
|
@ -263,10 +263,6 @@ double Effect::animationTime(int defaultTime)
|
|||
return qMax(defaultTime * effects->animationTimeFactor(), 1.);
|
||||
}
|
||||
|
||||
void Effect::numberDesktopsChanged(int)
|
||||
{
|
||||
}
|
||||
|
||||
//****************************************
|
||||
// EffectsHandler
|
||||
//****************************************
|
||||
|
|
|
@ -463,13 +463,6 @@ public:
|
|||
|
||||
virtual bool borderActivated(ElectricBorder border);
|
||||
|
||||
/**
|
||||
* called when the number of currently existing desktops is changed.
|
||||
* @param old The previous number of desktops in used.
|
||||
* @see EffectsHandler::numberOfDesktops.
|
||||
*/
|
||||
virtual void numberDesktopsChanged(int old);
|
||||
|
||||
static int displayWidth();
|
||||
static int displayHeight();
|
||||
static QPoint cursorPos();
|
||||
|
@ -826,6 +819,13 @@ Q_SIGNALS:
|
|||
* @since 4.7
|
||||
**/
|
||||
void desktopChanged(int oldDesktop, int newDesktop);
|
||||
/**
|
||||
* Signal emitted when the number of currently existing desktops is changed.
|
||||
* @param old The previous number of desktops in used.
|
||||
* @see EffectsHandler::numberOfDesktops.
|
||||
* @since 4.7
|
||||
*/
|
||||
void numberDesktopsChanged(int old);
|
||||
/**
|
||||
* Signal emitted when a new window has been added to the Workspace.
|
||||
* @param w The added window
|
||||
|
|
|
@ -1686,9 +1686,7 @@ void Workspace::setNumberOfDesktops(int n)
|
|||
|
||||
// reset the desktop change osd
|
||||
desktop_change_osd->numberDesktopsChanged();
|
||||
// inform effects
|
||||
if (effects)
|
||||
static_cast< EffectsHandlerImpl* >(effects)->numberDesktopsChanged(old_number_of_desktops);
|
||||
emit numberDesktopsChanged(old_number_of_desktops);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -922,6 +922,7 @@ Q_SIGNALS:
|
|||
signals:
|
||||
void desktopPresenceChanged(KWin::Client*, int);
|
||||
void currentDesktopChanged(int);
|
||||
void numberDesktopsChanged(int oldNumberOfDesktops);
|
||||
void clientAdded(KWin::Client*);
|
||||
void clientRemoved(KWin::Client*);
|
||||
void clientActivated(KWin::Client*);
|
||||
|
|
Loading…
Reference in New Issue