diff --git a/InvisPopup.Designer.cs b/InvisPopup.Designer.cs deleted file mode 100644 index 1ae7d0e6..00000000 --- a/InvisPopup.Designer.cs +++ /dev/null @@ -1,47 +0,0 @@ -namespace VRCX -{ - partial class InvisPopup - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // InvisPopup - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(148, 0); - this.Name = "InvisPopup"; - this.Opacity = 0D; - this.Text = "InvisPopup"; - this.ResumeLayout(false); - - } - - #endregion - } -} \ No newline at end of file diff --git a/InvisPopup.cs b/InvisPopup.cs deleted file mode 100644 index d3017894..00000000 --- a/InvisPopup.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace VRCX -{ - public partial class InvisPopup : Form - { - public InvisPopup() - { - StartPosition = FormStartPosition.Manual; - Location = new Point(-Width, -Height); - InitializeComponent(); - } - } -} diff --git a/InvisPopup.resx b/InvisPopup.resx deleted file mode 100644 index 1af7de15..00000000 --- a/InvisPopup.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/VRCX.csproj b/VRCX.csproj index 08b96366..5cde8085 100644 --- a/VRCX.csproj +++ b/VRCX.csproj @@ -83,12 +83,6 @@ - - Form - - - InvisPopup.cs - @@ -129,9 +123,6 @@ Form - - InvisPopup.cs - VRForm.cs diff --git a/WinformThemer.cs b/WinformThemer.cs index a9b141ef..057908d7 100644 --- a/WinformThemer.cs +++ b/WinformThemer.cs @@ -59,29 +59,16 @@ namespace VRCX /// public static void SetThemeToGlobal(List
forms) { - //Save current active form so we can refocus on this at the end - var activeForm = Form.ActiveForm; - - //Show and focus on the invisible popup - InvisPopupHandler.Show(); - //For each form, set the theme, then move focus onto it to force refresh foreach(Form form in forms) { //Set the theme of the window SetThemeToGlobal(form.Handle); - //Move focus onto it to force refresh if not minimized - if (form.WindowState != FormWindowState.Minimized) - form.Activate(); + //Change opacity to foce full redraw + form.Opacity = 0.99999; + form.Opacity = 1; } - - //Close + Dispose the invisible popup - InvisPopupHandler.Close(); - - //Restore focus to previous active form - if(activeForm != null && activeForm.WindowState != FormWindowState.Minimized) - activeForm.Activate(); } private static void SetThemeToGlobal(IntPtr handle) @@ -111,26 +98,6 @@ namespace VRCX return theme; } - internal static class InvisPopupHandler - { - private static InvisPopup instance; - - internal static void Show() - { - if(instance == null) - instance = new InvisPopup(); - instance.Show(); - instance.Activate(); - } - - internal static void Close() - { - instance.Close(); - instance.Dispose(); - instance = null; - } - } - internal static class PInvoke { [DllImport("DwmApi")]