diff --git a/KWinInterface.h b/KWinInterface.h index e0419ac0fa..2cf828cd59 100644 --- a/KWinInterface.h +++ b/KWinInterface.h @@ -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 diff --git a/workspace.cpp b/workspace.cpp index ad5d80ac49..940d8f7c4a 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -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 diff --git a/workspace.h b/workspace.h index 852fc8a538..c388ce687f 100644 --- a/workspace.h +++ b/workspace.h @@ -211,6 +211,8 @@ public: void unclutterDesktop(); void doNotManage(QString); void setCurrentDesktop( int new_desktop ); + void nextDesktop(); + void previousDesktop(); QString desktopName( int desk );