diff --git a/src/SFML/Window/Linux/WindowImplX11.cpp b/src/SFML/Window/Linux/WindowImplX11.cpp
index db88f8cd..a11b15d1 100644
--- a/src/SFML/Window/Linux/WindowImplX11.cpp
+++ b/src/SFML/Window/Linux/WindowImplX11.cpp
@@ -67,15 +67,16 @@ namespace priv
 ////////////////////////////////////////////////////////////
 WindowImplX11::WindowImplX11(WindowHandle handle) :
 myWindow      (0),
+myInputMethod (NULL),
+myInputContext(NULL),
 myIsExternal  (true),
 myAtomClose   (0),
 myOldVideoMode(-1),
 myHiddenCursor(0),
-myInputContext(NULL),
 myKeyRepeat   (true)
 {
-    // Get the display and screen
-    myDisplay = myDisplayRef.GetDisplay();
+    // Open a connection with the X server
+    myDisplay = XOpenDisplay(NULL);
     myScreen  = DefaultScreen(myDisplay);
 
     // Save the window handle
@@ -107,15 +108,16 @@ myKeyRepeat   (true)
 ////////////////////////////////////////////////////////////
 WindowImplX11::WindowImplX11(VideoMode mode, const std::string& title, unsigned long style) :
 myWindow      (0),
+myInputMethod (NULL),
+myInputContext(NULL),
 myIsExternal  (false),
 myAtomClose   (0),
 myOldVideoMode(-1),
 myHiddenCursor(0),
-myInputContext(NULL),
 myKeyRepeat   (true)
 {
-    // Get the display and screen
-    myDisplay = myDisplayRef.GetDisplay();
+    // Open a connection with the X server
+    myDisplay = XOpenDisplay(NULL);
     myScreen  = DefaultScreen(myDisplay);
 
     // Compute position and size
@@ -260,7 +262,14 @@ WindowImplX11::~WindowImplX11()
     {
         XDestroyWindow(myDisplay, myWindow);
         XFlush(myDisplay);
-    }
+    }
+
+    // Close the input method
+    if (myInputMethod)
+        XCloseIM(myInputMethod);
+
+    // Close the connection with the X server
+    XCloseDisplay(myDisplay);
 }
 
 
@@ -507,7 +516,7 @@ void WindowImplX11::SwitchToFullscreen(const VideoMode& mode)
         else
         {
             // Failed to get the screen configuration
-            std::cerr << "Failed to get the current screen configuration for fullscreen mode, switching to windiw mode" << std::endl;
+            std::cerr << "Failed to get the current screen configuration for fullscreen mode, switching to window mode" << std::endl;
         }
     }
     else
@@ -531,18 +540,21 @@ void WindowImplX11::Initialize()
     XSetWMProtocols(myDisplay, myWindow, &myAtomClose, 1);
 
     // Create the input context
-    XIM inputMethod = myDisplayRef.GetInputMethod();
-    if (inputMethod)
+    myInputMethod = XOpenIM(myDisplay, NULL, NULL, NULL);
+    if (myInputMethod)
     {
-        myInputContext = XCreateIC(inputMethod,
+        myInputContext = XCreateIC(myInputMethod,
                                    XNClientWindow, myWindow,
                                    XNFocusWindow,  myWindow,
                                    XNInputStyle,   XIMPreeditNothing  | XIMStatusNothing,
                                    NULL);
-        
-        if (!myInputContext)
-            std::cerr << "Failed to create input context for window -- TextEntered event won't be able to return unicode" << std::endl;
+    }
+    else
+    {
+        myInputContext = NULL;
     }
+    if (!myInputContext)
+        std::cerr << "Failed to create input context for window -- TextEntered event won't be able to return unicode" << std::endl;
 
     // Show the window
     XMapWindow(myDisplay, myWindow);
diff --git a/src/SFML/Window/Linux/WindowImplX11.hpp b/src/SFML/Window/Linux/WindowImplX11.hpp
index a0463b13..8065349e 100644
--- a/src/SFML/Window/Linux/WindowImplX11.hpp
+++ b/src/SFML/Window/Linux/WindowImplX11.hpp
@@ -30,7 +30,6 @@
 ////////////////////////////////////////////////////////////
 #include <SFML/Window/Event.hpp>
 #include <SFML/Window/WindowImpl.hpp>
-#include <SFML/Window/Linux/DisplayRef.hpp>
 #include <X11/Xlib.h>
 #include <set>
 #include <string>
@@ -183,15 +182,15 @@ private :
     ////////////////////////////////////////////////////////////
     // Member data
     ////////////////////////////////////////////////////////////
-    DisplayRef myDisplayRef;          ///< Connection to the X server
     ::Window   myWindow;              ///< X11 structure defining our window
     ::Display* myDisplay;             ///< Pointer to the display
-    int        myScreen;              ///< Screen identifier
+    int        myScreen;              ///< Screen identifier
+    XIM        myInputMethod;         ///< Input method linked to the X display
+    XIC        myInputContext;        ///< Input context used to get unicode input in our window
     bool       myIsExternal;          ///< Tell whether the window has been created externally or by SFML
     Atom       myAtomClose;           ///< Atom used to identify the close event
     int        myOldVideoMode;        ///< Video mode in use before we switch to fullscreen
     Cursor     myHiddenCursor;        ///< As X11 doesn't provide cursor hidding, we must create a transparent one
-    XIC        myInputContext;        ///< Input context used to get unicode input in our window
     bool       myKeyRepeat;           ///< Is the KeyRepeat feature enabled ?
     XEvent     myLastKeyReleaseEvent; ///< Last key release event we received (needed for discarding repeated key events)
 };