Index: xbmc/WinSystemX11.cpp
===================================================================
--- xbmc/WinSystemX11.cpp	(revision 25008)
+++ xbmc/WinSystemX11.cpp	(working copy)
@@ -181,6 +181,67 @@
   return false;
 }
 
+bool CWinSystemX11::SetFitToScreen(bool fitToScreen, RESOLUTION_INFO& res, bool blankOtherDisplays)
+{
+  m_nWidth      = res.iWidth;
+  m_nHeight     = res.iHeight;
+  m_bFitToScreen = fitToScreen;
+  m_bFullScreen = false;
+
+#if defined(HAS_XRANDR)
+
+  g_xrandr.RestoreState();
+
+#endif
+
+  int options = SDL_OPENGL;
+  if (m_bFitToScreen)
+    options |= SDL_NOFRAME;
+  else
+    options |= SDL_RESIZABLE;
+
+  if ((m_SDLSurface = SDL_SetVideoMode(m_nWidth, m_nHeight, 0, options)))
+  {
+    RefreshGlxContext();
+    if (m_bFitToScreen)
+      SetAlwaysAbove();
+    return true;
+  }
+
+  return false;
+}
+
+void CWinSystemX11::SetAlwaysAbove()
+{
+  SDL_SysWMinfo info;
+
+  SDL_VERSION(&info.version);
+  if (SDL_GetWMInfo(&info))
+  {
+    Window win = info.info.x11.wmwindow;
+    Display *disp = info.info.x11.display;
+
+    CLog::Log(LOGDEBUG, "Setting window state above.");
+
+    XEvent e;
+    e.xclient.type = ClientMessage;
+    e.xclient.serial = 0;
+    e.xclient.send_event = True;
+    e.xclient.window = win;
+    e.xclient.message_type = XInternAtom(disp, "_NET_WM_STATE", False);
+    e.xclient.format = 32;
+    e.xclient.data.l[0] = 1; // set action
+    e.xclient.data.l[1] = XInternAtom(disp, "_NET_WM_STATE_ABOVE", False);
+    e.xclient.data.l[2] = 0;
+    e.xclient.data.l[3] = 0;
+
+    XSendEvent (disp, DefaultRootWindow(disp), False,
+                SubstructureRedirectMask | SubstructureNotifyMask, &e);
+
+    //ModifyWindowProperty(display, window, WIN_PROP_ABOVE, ACTION_SET);
+  }
+}
+
 void CWinSystemX11::UpdateResolutions()
 {
   CWinSystemBase::UpdateResolutions();
Index: xbmc/AdvancedSettings.cpp
===================================================================
--- xbmc/AdvancedSettings.cpp	(revision 25008)
+++ xbmc/AdvancedSettings.cpp	(working copy)
@@ -224,6 +224,7 @@
   m_curlretries = 2;
 
   m_fullScreen = m_startFullScreen = false;
+  m_fitToScreen = false;
 
   m_playlistRetries = 100;
   m_playlistTimeout = 20; // 20 seconds timeout
@@ -500,6 +501,7 @@
   XMLUtils::GetBoolean(pRootElement, "usemultipaths", m_useMultipaths);
 #ifdef HAS_SDL
   XMLUtils::GetBoolean(pRootElement, "fullscreen", m_startFullScreen);
+  XMLUtils::GetBoolean(pRootElement, "fittoscreen", m_fitToScreen);
 #endif
 
   XMLUtils::GetInt(pRootElement, "songinfoduration", m_songInfoDuration, 0, INT_MAX);
Index: xbmc/WinSystemX11.h
===================================================================
--- xbmc/WinSystemX11.h	(revision 25008)
+++ xbmc/WinSystemX11.h	(working copy)
@@ -52,6 +52,8 @@
   // Local to WinSystemX11 only
   Display*  GetDisplay() { return m_dpy; }
   GLXWindow GetWindow() { return m_glWindow; }
+  void SetAlwaysAbove();
+  bool SetFitToScreen(bool fitToScreen, RESOLUTION_INFO& res, bool blankOtherDisplays);
 
 protected:  
   bool RefreshGlxContext();
@@ -62,6 +64,7 @@
   Window       m_wmWindow;
   Display*     m_dpy; 
   bool         m_bWasFullScreenBeforeMinimize;
+  bool         m_bFitToScreen;
 };
 
 #endif // WINDOW_SYSTEM_H
Index: xbmc/AdvancedSettings.h
===================================================================
--- xbmc/AdvancedSettings.h	(revision 25008)
+++ xbmc/AdvancedSettings.h	(working copy)
@@ -205,6 +205,7 @@
     bool m_fullScreen;
     bool m_startFullScreen;
     bool m_alwaysOnTop;  /* makes xbmc to run always on top .. osx/win32 only .. */
+    bool m_fitToScreen; /* run in maximized window with no mouse grab, overriding all other video settings. Linux only. */
     int m_playlistRetries;
     int m_playlistTimeout;
     bool m_GLRectangleHack;
Index: guilib/GraphicContext.cpp
===================================================================
--- guilib/GraphicContext.cpp	(revision 25008)
+++ guilib/GraphicContext.cpp	(working copy)
@@ -318,8 +318,14 @@
     return;
   }
   
-  if (res >= RES_DESKTOP)
+  if (g_advancedSettings.m_fitToScreen)
   {
+    res = RES_DESKTOP;
+    g_advancedSettings.m_fullScreen = false;
+    m_bFullScreenRoot = false;
+  }
+  else if (res >= RES_DESKTOP)
+  {
     g_advancedSettings.m_fullScreen = true;
     m_bFullScreenRoot = true;
   }
@@ -345,6 +351,8 @@
     g_Windowing.SetFullScreen(true,  g_settings.m_ResInfo[res], false);
 #endif
   }
+  else if (g_advancedSettings.m_fitToScreen)
+    g_Windowing.SetFitToScreen(true, g_settings.m_ResInfo[res], false);
   else if (lastRes >= RES_DESKTOP )
     g_Windowing.SetFullScreen(false, g_settings.m_ResInfo[res], false);
   else
