Index: branches/gui/src/lib/event/event_def.h
===================================================================
--- branches/gui/src/lib/event/event_def.h	(revision 7904)
+++ branches/gui/src/lib/event/event_def.h	(revision 7905)
@@ -28,4 +28,5 @@
   EV_JOY_BUTTON,
 
+  EV_WINDOW_FOCUS,
   EV_VIDEO_RESIZE,
 
Index: branches/gui/src/lib/event/event_handler.cc
===================================================================
--- branches/gui/src/lib/event/event_handler.cc	(revision 7904)
+++ branches/gui/src/lib/event/event_handler.cc	(revision 7905)
@@ -388,4 +388,8 @@
         ev.type = EV_JOY_BUTTON;
         break;
+      case SDL_ACTIVEEVENT:
+        ev.type = EV_WINDOW_FOCUS;
+        ev.bPressed = (event.active.gain != 0);
+        break;
       case SDL_VIDEORESIZE:
         ev.resize = event.resize;
Index: branches/gui/src/lib/gui/gl_gui/glgui_cursor.cc
===================================================================
--- branches/gui/src/lib/gui/gl_gui/glgui_cursor.cc	(revision 7904)
+++ branches/gui/src/lib/gui/gl_gui/glgui_cursor.cc	(revision 7905)
@@ -33,4 +33,5 @@
 
     this->subscribeEvent(ES_MENU,  EV_MOUSE_MOTION);
+    this->subscribeEvent(ES_MENU, EV_WINDOW_FOCUS);
 
 
@@ -73,18 +74,17 @@
     this->backMaterial().setDiffuse(color.x, color.y, color.z);
 
-    //if (this->movement != Vector2D())
+    if (this->movement != Vector2D())
     {
-/*      if (this->getAbsCoor2D().x < 0.0 )
+      if (this->getAbsCoor2D().x < 0.0 )
         movement.x = -this->getAbsCoor2D().x;
-      if (this->getAbsCoor2D().x > 200.0)
-        movement.x = (200.0-this->getAbsCoor2D().x);
+      if (this->getAbsCoor2D().x > this->_maxBorders.x)
+        movement.x = (this->_maxBorders.x-this->getAbsCoor2D().x);
       if (this->getAbsCoor2D().y < 0.0 )
-        movement.x = -this->getAbsCoor2D().y;
-      if (this->getAbsCoor2D().y > 200.0)
-        movement.x = (200.0-this->getAbsCoor2D().y);*/
+        movement.y = -this->getAbsCoor2D().y;
+      if (this->getAbsCoor2D().y > this->_maxBorders.y)
+        movement.y = (this->_maxBorders.y-this->getAbsCoor2D().y);
 
+      newPos += movement;
 
-
-      //this->shiftCoor2D(movement);
       this->setAbsCoor2D(newPos);
       movement = Vector2D();
@@ -106,7 +106,16 @@
     switch (event.type)
     {
+      case EV_WINDOW_FOCUS:
+        if (event.bPressed)
+        {
+          int mouseX, mouseY;
+          SDL_GetMouseState(&mouseX, &mouseY);
+          newPos = Vector2D(mouseX, mouseY);
+        }
+        break;
       case EV_MOUSE_MOTION:
-        newPos = Vector2D(event.x, event.y);
-        movement += Vector2D(event.xRel * _mouseSensitivity, event.yRel * _mouseSensitivity);
+        // newPos = Vector2D(event.x, event.y);
+        movement += Vector2D((float)event.xRel * _mouseSensitivity, (float)event.yRel * _mouseSensitivity);
+        movement.debug();
         break;
 
Index: branches/gui/src/lib/gui/gl_gui/glgui_cursor.h
===================================================================
--- branches/gui/src/lib/gui/gl_gui/glgui_cursor.h	(revision 7904)
+++ branches/gui/src/lib/gui/gl_gui/glgui_cursor.h	(revision 7905)
@@ -30,4 +30,6 @@
     static float mouseSensitivity() { return GLGuiCursor::_mouseSensitivity; };
 
+    void setMaxBorders(const Vector2D& maxBorders) { this->_maxBorders = maxBorders; };
+
     void init();
     const Vector2D& position() const { return Element2D::getAbsCoor2D(); }
@@ -38,4 +40,6 @@
     virtual void process(const Event& event);
   private:
+
+    Vector2D      _maxBorders;
 
     Vector2D      newPos;
Index: branches/gui/src/lib/gui/gl_gui/glgui_handler.cc
===================================================================
--- branches/gui/src/lib/gui/gl_gui/glgui_handler.cc	(revision 7904)
+++ branches/gui/src/lib/gui/gl_gui/glgui_handler.cc	(revision 7905)
@@ -24,4 +24,7 @@
 #include "class_list.h"
 
+
+/// TAKE THIS OUT OF HERE.
+#include "graphics_engine.h"
 
 namespace OrxGui
@@ -64,4 +67,5 @@
       this->cursor = new GLGuiCursor();
     this->cursor->show();
+    this->cursor->setMaxBorders(Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY()));
   }
 
