mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-03-12 16:05:08 +01:00
Reduce OSD flickering
This commit is contained in:
parent
7a66bb8858
commit
75b47af114
|
|
@ -15,12 +15,23 @@ namespace CommonHelpers
|
|||
return uint.MaxValue;
|
||||
|
||||
var osdSlot = typeof(OSD).GetField("m_osdSlot",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||
var value = osdSlot.GetValue(osd);
|
||||
if (value is null)
|
||||
return uint.MaxValue;
|
||||
|
||||
return (uint)value;
|
||||
}
|
||||
|
||||
public static uint OSDIndex(String name)
|
||||
{
|
||||
var entries = OSD.GetOSDEntries().ToList();
|
||||
for (int i = 0; i < entries.Count(); i++)
|
||||
{
|
||||
if (entries[i].Owner == name)
|
||||
return (uint)i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,9 +204,8 @@ namespace PerformanceOverlay
|
|||
try
|
||||
{
|
||||
// recreate OSD if not index 0
|
||||
if (osd != null && osd.OSDIndex() != 0)
|
||||
if (OSDHelpers.OSDIndex("PerformanceOverlay") != 0)
|
||||
osdClose();
|
||||
|
||||
if (osd == null)
|
||||
osd = new OSD("PerformanceOverlay");
|
||||
|
||||
|
|
|
|||
|
|
@ -266,8 +266,8 @@ namespace PowerControl
|
|||
|
||||
try
|
||||
{
|
||||
// recreate OSD if not index 0
|
||||
if (osd != null && osd.OSDIndex() == 0)
|
||||
// recreate OSD if index 0
|
||||
if (OSDHelpers.OSDIndex("Power Control") == 0 && OSD.GetOSDCount() > 1)
|
||||
osdClose();
|
||||
if (osd == null)
|
||||
osd = new OSD("Power Control");
|
||||
|
|
|
|||
Loading…
Reference in a new issue