forked from Mirrors/openclonk
parent
4b3b56ff22
commit
c4506a2b69
|
@ -640,7 +640,7 @@ void C4Application::GameTick()
|
|||
QuitGame();
|
||||
break;
|
||||
}
|
||||
if(Config.Graphics.Windowed == 2 && !isEditor)
|
||||
if(Config.Graphics.Windowed == 2 && FullScreenMode())
|
||||
Application.SetVideoMode(GetConfigWidth(), GetConfigHeight(), Config.Graphics.BitDepth, Config.Graphics.RefreshRate, Config.Graphics.Monitor, true);
|
||||
break;
|
||||
case C4AS_AfterGame:
|
||||
|
@ -804,13 +804,13 @@ void C4Application::NextTick()
|
|||
pGameTimer->Set();
|
||||
}
|
||||
|
||||
bool C4Application::FullScreenMode()
|
||||
bool C4Application::FullScreenMode()
|
||||
{
|
||||
if(isEditor)
|
||||
return false;
|
||||
if(!Config.Graphics.Windowed)
|
||||
return true;
|
||||
if(Config.Graphics.Windowed == 2 && AppState == C4AS_Game)
|
||||
if(Config.Graphics.Windowed == 2 && Game.IsRunning)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -457,7 +457,7 @@ static bool fullscreen_needs_restore = false;
|
|||
static gboolean fullscreen_restore(gpointer data)
|
||||
{
|
||||
if (fullscreen_needs_restore)
|
||||
Application.SetVideoMode(Application.GetConfigWidth(), Application.GetConfigHeight(), Config.Graphics.BitDepth, Config.Graphics.RefreshRate, Config.Graphics.Monitor, !Config.Graphics.Windowed);
|
||||
Application.SetVideoMode(Application.GetConfigWidth(), Application.GetConfigHeight(), Config.Graphics.BitDepth, Config.Graphics.RefreshRate, Config.Graphics.Monitor, Application.FullScreenMode());
|
||||
fullscreen_needs_restore = false;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -465,7 +465,7 @@ static gboolean fullscreen_restore(gpointer data)
|
|||
static gboolean OnFocusInFS(GtkWidget *widget, GdkEvent *event, gpointer user_data)
|
||||
{
|
||||
Application.Active = true;
|
||||
if (!Config.Graphics.Windowed)
|
||||
if (Application.FullScreenMode())
|
||||
{
|
||||
fullscreen_needs_restore = true;
|
||||
gdk_threads_add_idle(fullscreen_restore, NULL);
|
||||
|
@ -475,7 +475,7 @@ static gboolean OnFocusInFS(GtkWidget *widget, GdkEvent *event, gpointer user_d
|
|||
static gboolean OnFocusOutFS(GtkWidget *widget, GdkEvent *event, gpointer user_data)
|
||||
{
|
||||
Application.Active = false;
|
||||
if (!Config.Graphics.Windowed)
|
||||
if (Application.FullScreenMode())
|
||||
{
|
||||
Application.RestoreVideoMode();
|
||||
gtk_window_iconify(GTK_WINDOW(widget));
|
||||
|
|
|
@ -833,6 +833,7 @@ bool C4AbstractApp::SetVideoMode(unsigned int iXRes, unsigned int iYRes, unsigne
|
|||
pWindow->SetSize(iXRes, iYRes);
|
||||
OnResolutionChanged(iXRes, iYRes);
|
||||
}
|
||||
::SetWindowPos(pWindow->hWindow, NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREDRAW|SWP_FRAMECHANGED);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -886,7 +887,6 @@ bool C4AbstractApp::SetVideoMode(unsigned int iXRes, unsigned int iYRes, unsigne
|
|||
break;
|
||||
}
|
||||
if (!fFound) return false;
|
||||
Log("got that far");
|
||||
|
||||
dspMode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||
if (iRefreshRate != 0)
|
||||
|
|
Loading…
Reference in New Issue