Skip to content

Commit

Permalink
Merge pull request #3004 from nikolai-r/master
Browse files Browse the repository at this point in the history
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 c4622ca
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions xbmc/windowing/WinEventsSDL.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c4622ca

Please sign in to comment.