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:
Malte Starostik 2001-06-09 05:00:46 +00:00
parent a9c55776ae
commit f8c8380275
3 changed files with 15 additions and 1 deletions

View file

@ -17,7 +17,9 @@ class KWinInterface : virtual public DCOPObject
virtual void doNotManage(QString)= 0;
virtual void showWindowMenuAt(unsigned long winId, int x, int y)= 0;
virtual void setCurrentDesktop(int)= 0;
virtual int currentDesktop() const = 0;
virtual void nextDesktop() = 0;
virtual void previousDesktop() = 0;
};
#endif

View file

@ -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

View file

@ -211,6 +211,8 @@ public:
void unclutterDesktop();
void doNotManage(QString);
void setCurrentDesktop( int new_desktop );
void nextDesktop();
void previousDesktop();
QString desktopName( int desk );