Permalink
Browse files

Merge pull request #3004 from nikolai-r/master

Fix return from fullscreen for linux/gnome not returning to previous size.
  • Loading branch information...
davilla committed Aug 27, 2013
2 parents 6aeac5d + 51a4418 commit c4622ca70ecc53323562842312795a07fc136127
Showing with 11 additions and 0 deletions.
  1. +11 −0 xbmc/windowing/WinEventsSDL.cpp
@@ -26,6 +26,7 @@
#include "Application.h"
#include "ApplicationMessenger.h"
#include "GUIUserMessages.h"
+#include "settings/DisplaySettings.h"
#include "guilib/GUIWindowManager.h"
#include "guilib/Key.h"
#ifdef HAS_SDL_JOYSTICK
@@ -363,6 +364,16 @@ bool CWinEventsSDL::MessagePump()
}
case SDL_VIDEORESIZE:
{
+ // Under linux returning from fullscreen, SDL sends an extra event to resize to the desktop
+ // resolution causing the previous window dimensions to be lost. This is needed to rectify
+ // that problem.
+ if(!g_Windowing.IsFullScreen())
+ {
+ int RES_SCREEN = g_Windowing.DesktopResolution(g_Windowing.GetCurrentScreen());
+ if((event.resize.w == CDisplaySettings::Get().GetResolutionInfo(RES_SCREEN).iWidth) &&
+ (event.resize.h == CDisplaySettings::Get().GetResolutionInfo(RES_SCREEN).iHeight))
+ break;
+ }
XBMC_Event newEvent;
newEvent.type = XBMC_VIDEORESIZE;
newEvent.resize.w = event.resize.w;

0 comments on commit c4622ca

Please sign in to comment.