forked from Mirror/Ryujinx
fix fullscreen toggling (#1364)
This commit is contained in:
parent
9e141bc3da
commit
3c1f220c5e
1 changed files with 16 additions and 4 deletions
|
@ -94,6 +94,7 @@ namespace Ryujinx.Ui
|
||||||
this.DefaultWidth = monitorWidth < 1280 ? monitorWidth : 1280;
|
this.DefaultWidth = monitorWidth < 1280 ? monitorWidth : 1280;
|
||||||
this.DefaultHeight = monitorHeight < 760 ? monitorHeight : 760;
|
this.DefaultHeight = monitorHeight < 760 ? monitorHeight : 760;
|
||||||
|
|
||||||
|
this.WindowStateEvent += MainWindow_WindowStateEvent;
|
||||||
this.DeleteEvent += Window_Close;
|
this.DeleteEvent += Window_Close;
|
||||||
_fullScreen.Activated += FullScreen_Toggled;
|
_fullScreen.Activated += FullScreen_Toggled;
|
||||||
|
|
||||||
|
@ -192,6 +193,11 @@ namespace Ryujinx.Ui
|
||||||
_statusBar.Hide();
|
_statusBar.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void MainWindow_WindowStateEvent(object o, WindowStateEventArgs args)
|
||||||
|
{
|
||||||
|
_fullScreen.Label = args.Event.NewWindowState.HasFlag(Gdk.WindowState.Fullscreen) ? "Exit Fullscreen" : "Enter Fullscreen";
|
||||||
|
}
|
||||||
|
|
||||||
#if USE_DEBUGGING
|
#if USE_DEBUGGING
|
||||||
private void _openDebugger_Opened(object sender, EventArgs e)
|
private void _openDebugger_Opened(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -505,6 +511,11 @@ namespace Ryujinx.Ui
|
||||||
|
|
||||||
_glWidget.ShowAll();
|
_glWidget.ShowAll();
|
||||||
EditFooterForGameRender();
|
EditFooterForGameRender();
|
||||||
|
|
||||||
|
if (this.Window.State.HasFlag(Gdk.WindowState.Fullscreen))
|
||||||
|
{
|
||||||
|
ToggleExtraWidgets(false);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_glWidget.WaitEvent.WaitOne();
|
_glWidget.WaitEvent.WaitOne();
|
||||||
|
@ -520,6 +531,11 @@ namespace Ryujinx.Ui
|
||||||
// NOTE: Everything that is here will not be executed when you close the UI.
|
// NOTE: Everything that is here will not be executed when you close the UI.
|
||||||
Application.Invoke(delegate
|
Application.Invoke(delegate
|
||||||
{
|
{
|
||||||
|
if (this.Window.State.HasFlag(Gdk.WindowState.Fullscreen))
|
||||||
|
{
|
||||||
|
ToggleExtraWidgets(true);
|
||||||
|
}
|
||||||
|
|
||||||
_viewBox.Remove(_glWidget);
|
_viewBox.Remove(_glWidget);
|
||||||
_glWidget.Exit();
|
_glWidget.Exit();
|
||||||
|
|
||||||
|
@ -583,10 +599,6 @@ namespace Ryujinx.Ui
|
||||||
_footerBox.Hide();
|
_footerBox.Hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fullScreenToggled = this.Window.State.HasFlag(Gdk.WindowState.Fullscreen);
|
|
||||||
|
|
||||||
_fullScreen.Label = fullScreenToggled ? "Exit Fullscreen" : "Enter Fullscreen";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void UpdateGameMetadata(string titleId)
|
private static void UpdateGameMetadata(string titleId)
|
||||||
|
|
Loading…
Reference in a new issue