Expose int currentDesktop() const via DCOP
and added void nextDesktop() and void previousDesktop(), also available via DCOP. This makes it possible to use KGesture to cycle through desktops :) svn path=/trunk/kdebase/kwin/; revision=101071
This commit is contained in:
parent
a9c55776ae
commit
f8c8380275
3 changed files with 15 additions and 1 deletions
|
@ -17,7 +17,9 @@ class KWinInterface : virtual public DCOPObject
|
||||||
virtual void doNotManage(QString)= 0;
|
virtual void doNotManage(QString)= 0;
|
||||||
virtual void showWindowMenuAt(unsigned long winId, int x, int y)= 0;
|
virtual void showWindowMenuAt(unsigned long winId, int x, int y)= 0;
|
||||||
virtual void setCurrentDesktop(int)= 0;
|
virtual void setCurrentDesktop(int)= 0;
|
||||||
|
virtual int currentDesktop() const = 0;
|
||||||
|
virtual void nextDesktop() = 0;
|
||||||
|
virtual void previousDesktop() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2250,7 +2250,17 @@ void Workspace::setCurrentDesktop( int new_desktop ){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Workspace::nextDesktop()
|
||||||
|
{
|
||||||
|
int desktop = currentDesktop() + 1;
|
||||||
|
setCurrentDesktop(desktop > numberOfDesktops() ? 1 : desktop);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Workspace::previousDesktop()
|
||||||
|
{
|
||||||
|
int desktop = currentDesktop() - 1;
|
||||||
|
setCurrentDesktop(desktop ? desktop : numberOfDesktops());
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns the workspace's desktop widget. The desktop widget is
|
Returns the workspace's desktop widget. The desktop widget is
|
||||||
|
|
|
@ -211,6 +211,8 @@ public:
|
||||||
void unclutterDesktop();
|
void unclutterDesktop();
|
||||||
void doNotManage(QString);
|
void doNotManage(QString);
|
||||||
void setCurrentDesktop( int new_desktop );
|
void setCurrentDesktop( int new_desktop );
|
||||||
|
void nextDesktop();
|
||||||
|
void previousDesktop();
|
||||||
|
|
||||||
QString desktopName( int desk );
|
QString desktopName( int desk );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue