Index: /code/branches/console/src/orxonox/GraphicsEngine.cc
===================================================================
--- /code/branches/console/src/orxonox/GraphicsEngine.cc	(revision 1177)
+++ /code/branches/console/src/orxonox/GraphicsEngine.cc	(revision 1178)
@@ -40,6 +40,5 @@
 #include <OgreLogManager.h>
 #include <OgreTextureManager.h>
-#include <OgreRenderWindow.h>
-
+#include "core/InputManager.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
@@ -90,4 +89,5 @@
   {
     COUT(4) << "*** GraphicsEngine: Destroying objects..." << std::endl;
+    Ogre::WindowEventUtilities::removeWindowEventListener(this->renderWindow_, this);
     if (this->root_)
       delete this->root_;
@@ -184,4 +184,5 @@
   {
     this->renderWindow_ = root_->initialise(true, "OrxonoxV2");
+    Ogre::WindowEventUtilities::addWindowEventListener(this->renderWindow_, this);
     Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
     //TODO: Do NOT load all the groups, why are we doing that? And do we really do that? initialise != load...
@@ -289,3 +290,21 @@
         << "*** Ogre: " << message << std::endl;
   }
+
+    void GraphicsEngine::windowMoved(Ogre::RenderWindow *rw){
+        int w = rw->getWidth();
+        int h = rw->getHeight();
+        InputManager::getSingleton().setWindowExtents(w, h);
+    }
+
+    void GraphicsEngine::windowResized(Ogre::RenderWindow *rw){
+        int w = rw->getWidth();
+        int h = rw->getHeight();
+        InputManager::getSingleton().setWindowExtents(w, h);
+    }
+
+    void GraphicsEngine::windowFocusChanged(Ogre::RenderWindow *rw){
+        int w = rw->getWidth();
+        int h = rw->getHeight();
+        InputManager::getSingleton().setWindowExtents(w, h);
+    }
 }
Index: /code/branches/console/src/orxonox/GraphicsEngine.h
===================================================================
--- /code/branches/console/src/orxonox/GraphicsEngine.h	(revision 1177)
+++ /code/branches/console/src/orxonox/GraphicsEngine.h	(revision 1178)
@@ -42,5 +42,6 @@
 #include <OgrePrerequisites.h>
 #include <OgreLog.h>
-
+#include <OgreRenderWindow.h>
+#include <OgreWindowEventUtilities.h>
 #include "core/OrxonoxClass.h"
 
@@ -48,52 +49,54 @@
 namespace orxonox {
 
-  /**
+    /**
     @brief Graphics engine manager class
-  */
-  class _OrxonoxExport GraphicsEngine : public OrxonoxClass, public Ogre::LogListener
-  {
-    friend class ClassIdentifier<GraphicsEngine>;
-    public:
-      void setConfigPath(std::string path) { this->configPath_ = path; };
-      void setConfigValues();
-      void setup();
-      bool load(std::string path);
-      void loadRessourceLocations(std::string path);
-      Ogre::SceneManager* getSceneManager();
-      void initialise();
-      void destroy();
+    */
+    class _OrxonoxExport GraphicsEngine : public Ogre::WindowEventListener, public OrxonoxClass, public Ogre::LogListener
+    {
+        friend class ClassIdentifier<GraphicsEngine>;
+        public:
+            void setConfigPath(std::string path) { this->configPath_ = path; };
+            void setConfigValues();
+            void setup();
+            bool load(std::string path);
+            void loadRessourceLocations(std::string path);
+            Ogre::SceneManager* getSceneManager();
+            void initialise();
+            void destroy();
 
-      // several window properties
-      Ogre::RenderWindow* getRenderWindow() { return this->renderWindow_; }
-      size_t getWindowHandle();
-      int getWindowWidth() const;
-      int getWindowHeight() const;
+            // several window properties
+            Ogre::RenderWindow* getRenderWindow() { return this->renderWindow_; }
+            size_t getWindowHandle();
+            int getWindowWidth() const;
+            int getWindowHeight() const;
 
-      static GraphicsEngine& getSingleton();
-      static GraphicsEngine* getSingletonPtr() { return &getSingleton(); }
+            static GraphicsEngine& getSingleton();
+            static GraphicsEngine* getSingletonPtr() { return &getSingleton(); }
 
-    private:
-      // don't mess with singletons
-      GraphicsEngine();
-      ~GraphicsEngine();
-      GraphicsEngine(GraphicsEngine&) { }
+            void windowMoved(Ogre::RenderWindow* rw);
+            void windowResized(Ogre::RenderWindow* rw);
+            void windowFocusChanged(Ogre::RenderWindow* rw);
 
-      //! Method called by the LogListener from Ogre
-      void messageLogged(const std::string&, Ogre::LogMessageLevel,
-                         bool, const std::string&);
+        private:
+            // don't mess with singletons
+            GraphicsEngine();
+            ~GraphicsEngine();
+            GraphicsEngine(GraphicsEngine&) { }
 
-      Ogre::Root*         root_;        //!< Ogre's root
-      Ogre::SceneManager* scene_;       //!< scene manager of the game
-      Ogre::RenderWindow* renderWindow_;//!< the current render window
-      //bool               bOverwritePath_; //!< overwrites path
-      std::string         configPath_;  //!< path to config file
-      std::string         dataPath_;    //!< path to data file
-      std::string         ogreLogfile_; //!< log file name for Ogre log messages
-      int ogreLogLevelTrivial_;         //!< Corresponding Orxonx debug level for LL_TRIVIAL
-      int ogreLogLevelNormal_;          //!< Corresponding Orxonx debug level for LL_NORMAL
-      int ogreLogLevelCritical_;        //!< Corresponding Orxonx debug level for LL_CRITICAL
+            //! Method called by the LogListener from Ogre
+            void messageLogged(const std::string&, Ogre::LogMessageLevel,
+                             bool, const std::string&);
 
-  };
-
+            Ogre::Root*         root_;        //!< Ogre's root
+            Ogre::SceneManager* scene_;       //!< scene manager of the game
+            Ogre::RenderWindow* renderWindow_;//!< the current render window
+            //bool               bOverwritePath_; //!< overwrites path
+            std::string         configPath_;  //!< path to config file
+            std::string         dataPath_;    //!< path to data file
+            std::string         ogreLogfile_; //!< log file name for Ogre log messages
+            int ogreLogLevelTrivial_;         //!< Corresponding Orxonx debug level for LL_TRIVIAL
+            int ogreLogLevelNormal_;          //!< Corresponding Orxonx debug level for LL_NORMAL
+            int ogreLogLevelCritical_;        //!< Corresponding Orxonx debug level for LL_CRITICAL
+    };
 }
 
