mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-03-04 20:13:49 +01:00
Try to recreate overlay if OSDIndex is 0, or not-0
This commit is contained in:
parent
4de31ed48c
commit
1eb5067260
|
|
@ -168,7 +168,9 @@ namespace PerformanceOverlay
|
|||
|
||||
try
|
||||
{
|
||||
osdClose();
|
||||
// recreate OSD if not index 0
|
||||
if (osd != null && osd.OSDIndex() != 0)
|
||||
osdClose();
|
||||
|
||||
if (osd == null)
|
||||
osd = new OSD("PerformanceOverlay");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using CommonHelpers;
|
||||
using CommonHelpers;
|
||||
using CommonHelpers.FromLibreHardwareMonitor;
|
||||
using Microsoft.VisualBasic.Logging;
|
||||
using PowerControl.External;
|
||||
|
|
@ -243,20 +243,15 @@ namespace PowerControl
|
|||
{
|
||||
if (!rootMenu.Visible)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (osd != null)
|
||||
osd.Dispose();
|
||||
osd = null;
|
||||
}
|
||||
catch (SystemException)
|
||||
{
|
||||
}
|
||||
osdClose();
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// recreate OSD if not index 0
|
||||
if (osd != null && osd.OSDIndex() == 0)
|
||||
osdClose();
|
||||
if (osd == null)
|
||||
osd = new OSD("Power Control");
|
||||
osd.Update(rootMenu.Render(null));
|
||||
|
|
@ -274,7 +269,20 @@ namespace PowerControl
|
|||
public void Dispose()
|
||||
{
|
||||
components.Dispose();
|
||||
hideOSD();
|
||||
osdClose();
|
||||
}
|
||||
|
||||
private void osdClose()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (osd != null)
|
||||
osd.Dispose();
|
||||
osd = null;
|
||||
}
|
||||
catch (SystemException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue