Skip to content

Commit

Permalink
Fix bug where secondary screens were freezing their contents when unb…
Browse files Browse the repository at this point in the history
…lanking
  • Loading branch information
ceilingwaffle committed Mar 26, 2022
1 parent 4714e26 commit e247284
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 40 deletions.
2 changes: 2 additions & 0 deletions Focusu.GUI/Focusu.GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
<ItemGroup>
<ProjectReference Include="..\..\DependentValuePresentationFramework\DVPF.Core\DVPF.Core.csproj" />
<ProjectReference Include="..\..\OsuStatePresenter\OsuStatePresenter\OsuStatePresenter.csproj" />
<ProjectReference Include="..\..\OsuStatePresenter\submodules\ProcessMemoryDataFinder\OsuMemoryDataProvider\OsuMemoryDataProvider.csproj" />
<ProjectReference Include="..\..\OsuStatePresenter\submodules\ProcessMemoryDataFinder\ProcessMemoryDataFinder\ProcessMemoryDataFinder.csproj" />
</ItemGroup>


Expand Down
4 changes: 2 additions & 2 deletions Focusu.GUI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.2.6")]
[assembly: AssemblyFileVersion("0.2.5")]
[assembly: AssemblyVersion("0.2.8")]
[assembly: AssemblyFileVersion("0.2.8")]
16 changes: 16 additions & 0 deletions Focusu.GUI/Screen/ScreenBlankerForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ namespace Focusu.GUI.Screen
{
public class ScreenBlankerForm : Form
{
// Starting left position of the blank form.
// Initialised with some large value so we can later check if the form position has been set yet.
private int startLeftPos = int.MaxValue;

// Shows the form as topmost without stealing focus: https://stackoverflow.com/a/25219414
protected override bool ShowWithoutActivation
{
Expand Down Expand Up @@ -72,6 +76,12 @@ public void Blank()
{
this.Visible = false;
this.ShowDialog();

// Workaround fix to secondary screens freezing their contents when unblanking
if (this.startLeftPos == int.MaxValue)
this.startLeftPos = this.Left;

this.Left = this.startLeftPos;
}
}

Expand All @@ -88,6 +98,12 @@ public void Unblank()
{
this.Visible = false;
this.Hide();

// Workaround fix to secondary screens freezing their contents when unblanking
if (this.startLeftPos == int.MaxValue)
this.startLeftPos = this.Left;

this.Left = -16384;
}
}
}
Expand Down
120 changes: 120 additions & 0 deletions Focusu.GUI/Screen/ScreenBlankerForm.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
80 changes: 42 additions & 38 deletions Focusu.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DVPF.Core", "..\DependentVa
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Oppai.w.Net", "..\submodules\Oppai.w.Net\Oppai.w.Net\Oppai.w.Net.csproj", "{D02CC1ED-E1E8-4553-8942-0A1A855BEDB8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OsuStatePresenter", "..\OsuStatePresenter\OsuStatePresenter\OsuStatePresenter.csproj", "{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OsuStatePresenter", "..\OsuStatePresenter\OsuStatePresenter\OsuStatePresenter.csproj", "{715155EF-0118-4683-A3C3-FCCE7DC3C609}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProcessMemoryDataFinder", "..\OsuStatePresenter\submodules\ProcessMemoryDataFinder\ProcessMemoryDataFinder\ProcessMemoryDataFinder.csproj", "{36F7F957-D435-475A-BDC5-C7430B0E3098}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OsuMemoryDataProvider", "..\OsuStatePresenter\submodules\ProcessMemoryDataFinder\OsuMemoryDataProvider\OsuMemoryDataProvider.csproj", "{D2026C78-A5F5-42FF-A193-5FB79483C04A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OsuMemoryDataProvider", "..\OsuStatePresenter\submodules\ProcessMemoryDataFinder\OsuMemoryDataProvider\OsuMemoryDataProvider.csproj", "{76757758-E2DE-433E-B3A9-8E39E26D247C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProcessMemoryDataFinder", "..\OsuStatePresenter\submodules\ProcessMemoryDataFinder\ProcessMemoryDataFinder\ProcessMemoryDataFinder.csproj", "{94754D97-65F7-494B-A4CB-1BBE6D4824D1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -63,48 +63,52 @@ Global
{D02CC1ED-E1E8-4553-8942-0A1A855BEDB8}.Release|x64.Build.0 = Release|Any CPU
{D02CC1ED-E1E8-4553-8942-0A1A855BEDB8}.Release|x86.ActiveCfg = Release|Any CPU
{D02CC1ED-E1E8-4553-8942-0A1A855BEDB8}.Release|x86.Build.0 = Release|Any CPU
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}.Debug|x64.ActiveCfg = Debug|Any CPU
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}.Debug|x64.Build.0 = Debug|Any CPU
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}.Debug|x86.ActiveCfg = Debug|x86
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}.Debug|x86.Build.0 = Debug|x86
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}.Release|Any CPU.Build.0 = Release|Any CPU
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}.Release|x64.ActiveCfg = Release|Any CPU
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}.Release|x64.Build.0 = Release|Any CPU
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}.Release|x86.ActiveCfg = Release|x86
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0}.Release|x86.Build.0 = Release|x86
{36F7F957-D435-475A-BDC5-C7430B0E3098}.Debug|Any CPU.ActiveCfg = Debug|x86
{36F7F957-D435-475A-BDC5-C7430B0E3098}.Debug|x64.ActiveCfg = Debug|x64
{36F7F957-D435-475A-BDC5-C7430B0E3098}.Debug|x64.Build.0 = Debug|x64
{36F7F957-D435-475A-BDC5-C7430B0E3098}.Debug|x86.ActiveCfg = Debug|x86
{36F7F957-D435-475A-BDC5-C7430B0E3098}.Debug|x86.Build.0 = Debug|x86
{36F7F957-D435-475A-BDC5-C7430B0E3098}.Release|Any CPU.ActiveCfg = Release|x86
{36F7F957-D435-475A-BDC5-C7430B0E3098}.Release|x64.ActiveCfg = Release|x64
{36F7F957-D435-475A-BDC5-C7430B0E3098}.Release|x64.Build.0 = Release|x64
{36F7F957-D435-475A-BDC5-C7430B0E3098}.Release|x86.ActiveCfg = Release|x86
{36F7F957-D435-475A-BDC5-C7430B0E3098}.Release|x86.Build.0 = Release|x86
{76757758-E2DE-433E-B3A9-8E39E26D247C}.Debug|Any CPU.ActiveCfg = Debug|x86
{76757758-E2DE-433E-B3A9-8E39E26D247C}.Debug|x64.ActiveCfg = Debug|x64
{76757758-E2DE-433E-B3A9-8E39E26D247C}.Debug|x64.Build.0 = Debug|x64
{76757758-E2DE-433E-B3A9-8E39E26D247C}.Debug|x86.ActiveCfg = Debug|x86
{76757758-E2DE-433E-B3A9-8E39E26D247C}.Debug|x86.Build.0 = Debug|x86
{76757758-E2DE-433E-B3A9-8E39E26D247C}.Release|Any CPU.ActiveCfg = Release|x86
{76757758-E2DE-433E-B3A9-8E39E26D247C}.Release|x64.ActiveCfg = Release|x64
{76757758-E2DE-433E-B3A9-8E39E26D247C}.Release|x64.Build.0 = Release|x64
{76757758-E2DE-433E-B3A9-8E39E26D247C}.Release|x86.ActiveCfg = Release|x86
{76757758-E2DE-433E-B3A9-8E39E26D247C}.Release|x86.Build.0 = Release|x86
{715155EF-0118-4683-A3C3-FCCE7DC3C609}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{715155EF-0118-4683-A3C3-FCCE7DC3C609}.Debug|Any CPU.Build.0 = Debug|Any CPU
{715155EF-0118-4683-A3C3-FCCE7DC3C609}.Debug|x64.ActiveCfg = Debug|Any CPU
{715155EF-0118-4683-A3C3-FCCE7DC3C609}.Debug|x64.Build.0 = Debug|Any CPU
{715155EF-0118-4683-A3C3-FCCE7DC3C609}.Debug|x86.ActiveCfg = Debug|x86
{715155EF-0118-4683-A3C3-FCCE7DC3C609}.Debug|x86.Build.0 = Debug|x86
{715155EF-0118-4683-A3C3-FCCE7DC3C609}.Release|Any CPU.ActiveCfg = Release|Any CPU
{715155EF-0118-4683-A3C3-FCCE7DC3C609}.Release|Any CPU.Build.0 = Release|Any CPU
{715155EF-0118-4683-A3C3-FCCE7DC3C609}.Release|x64.ActiveCfg = Release|Any CPU
{715155EF-0118-4683-A3C3-FCCE7DC3C609}.Release|x64.Build.0 = Release|Any CPU
{715155EF-0118-4683-A3C3-FCCE7DC3C609}.Release|x86.ActiveCfg = Release|x86
{715155EF-0118-4683-A3C3-FCCE7DC3C609}.Release|x86.Build.0 = Release|x86
{D2026C78-A5F5-42FF-A193-5FB79483C04A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2026C78-A5F5-42FF-A193-5FB79483C04A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2026C78-A5F5-42FF-A193-5FB79483C04A}.Debug|x64.ActiveCfg = Debug|x64
{D2026C78-A5F5-42FF-A193-5FB79483C04A}.Debug|x64.Build.0 = Debug|x64
{D2026C78-A5F5-42FF-A193-5FB79483C04A}.Debug|x86.ActiveCfg = Debug|x86
{D2026C78-A5F5-42FF-A193-5FB79483C04A}.Debug|x86.Build.0 = Debug|x86
{D2026C78-A5F5-42FF-A193-5FB79483C04A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2026C78-A5F5-42FF-A193-5FB79483C04A}.Release|Any CPU.Build.0 = Release|Any CPU
{D2026C78-A5F5-42FF-A193-5FB79483C04A}.Release|x64.ActiveCfg = Release|x64
{D2026C78-A5F5-42FF-A193-5FB79483C04A}.Release|x64.Build.0 = Release|x64
{D2026C78-A5F5-42FF-A193-5FB79483C04A}.Release|x86.ActiveCfg = Release|x86
{D2026C78-A5F5-42FF-A193-5FB79483C04A}.Release|x86.Build.0 = Release|x86
{94754D97-65F7-494B-A4CB-1BBE6D4824D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94754D97-65F7-494B-A4CB-1BBE6D4824D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94754D97-65F7-494B-A4CB-1BBE6D4824D1}.Debug|x64.ActiveCfg = Debug|x64
{94754D97-65F7-494B-A4CB-1BBE6D4824D1}.Debug|x64.Build.0 = Debug|x64
{94754D97-65F7-494B-A4CB-1BBE6D4824D1}.Debug|x86.ActiveCfg = Debug|x86
{94754D97-65F7-494B-A4CB-1BBE6D4824D1}.Debug|x86.Build.0 = Debug|x86
{94754D97-65F7-494B-A4CB-1BBE6D4824D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94754D97-65F7-494B-A4CB-1BBE6D4824D1}.Release|Any CPU.Build.0 = Release|Any CPU
{94754D97-65F7-494B-A4CB-1BBE6D4824D1}.Release|x64.ActiveCfg = Release|x64
{94754D97-65F7-494B-A4CB-1BBE6D4824D1}.Release|x64.Build.0 = Release|x64
{94754D97-65F7-494B-A4CB-1BBE6D4824D1}.Release|x86.ActiveCfg = Release|x86
{94754D97-65F7-494B-A4CB-1BBE6D4824D1}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{EDE10745-1D26-4250-B887-7A6665687150} = {EF004CBC-C8BC-4DB6-A7AA-72D3063B75B1}
{D02CC1ED-E1E8-4553-8942-0A1A855BEDB8} = {EF004CBC-C8BC-4DB6-A7AA-72D3063B75B1}
{9CC0E5A7-B68B-436F-81A0-84797A82A4C0} = {EF004CBC-C8BC-4DB6-A7AA-72D3063B75B1}
{36F7F957-D435-475A-BDC5-C7430B0E3098} = {EF004CBC-C8BC-4DB6-A7AA-72D3063B75B1}
{76757758-E2DE-433E-B3A9-8E39E26D247C} = {EF004CBC-C8BC-4DB6-A7AA-72D3063B75B1}
{715155EF-0118-4683-A3C3-FCCE7DC3C609} = {EF004CBC-C8BC-4DB6-A7AA-72D3063B75B1}
{D2026C78-A5F5-42FF-A193-5FB79483C04A} = {EF004CBC-C8BC-4DB6-A7AA-72D3063B75B1}
{94754D97-65F7-494B-A4CB-1BBE6D4824D1} = {EF004CBC-C8BC-4DB6-A7AA-72D3063B75B1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {311E11BE-8884-422A-997F-3BE3E8F6C388}
Expand Down

0 comments on commit e247284

Please sign in to comment.