diff --git a/src/servers/app/RootLayer.cpp b/src/servers/app/RootLayer.cpp index 6dc97d6195..3c78d104bb 100644 --- a/src/servers/app/RootLayer.cpp +++ b/src/servers/app/RootLayer.cpp @@ -51,6 +51,7 @@ #include "Decorator.h" //#define DEBUG_ROOTLAYER +#define APPSERVER_ROOTLAYER_SHOW_WORKSPACE_NUMBER #ifdef DEBUG_ROOTLAYER #define STRACE(a) printf a @@ -1445,6 +1446,17 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg) show_final_scene(exFocus, exActive); if (string) free(string); + + #ifdef APPSERVER_ROOTLAYER_SHOW_WORKSPACE_NUMBER + { + // to draw the current Workspace index on screen. + BRegion reg(fVisible); + fDriver->ConstrainClippingRegion(®); + Draw(reg.Frame()); + fDriver->ConstrainClippingRegion(NULL); + } + #endif + break; } } @@ -1994,3 +2006,14 @@ void RootLayer::show_final_scene(WinBorder *exFocus, WinBorder *exActive) if (fLastMouseMoved == NULL) debugger("RootLayer::KeyboardEventHandler: 'fLastMouseMoved' can't be null.\n"); } + +void RootLayer::Draw(const BRect &r) +{ + fDriver->FillRect(r, fLayerData->ViewColor()); +#ifdef APPSERVER_ROOTLAYER_SHOW_WORKSPACE_NUMBER + char string[30]; + sprintf(string, "Workspace %ld", fActiveWksIndex+1); + fDriver->DrawString(string, strlen(string), BPoint(5,15), + fLayerData); +#endif +} diff --git a/src/servers/app/RootLayer.h b/src/servers/app/RootLayer.h index b435e80623..9365ed3a0e 100644 --- a/src/servers/app/RootLayer.h +++ b/src/servers/app/RootLayer.h @@ -121,6 +121,8 @@ public: void GoRedraw(const Layer *layer, const BRegion ®ion); void GoChangeWinBorderFeel(const WinBorder *winBorder, int32 newFeel); + virtual void Draw(const BRect &r); + // Debug methods void PrintToStream(void); thread_id LockingThread() { return fAllRegionsLock.LockingThread(); }