Skip to content

Commit

Permalink
Merge pull request #32 from cerebrate/dev
Browse files Browse the repository at this point in the history
Minor bug fixes.
  • Loading branch information
cerebrate authored Jan 24, 2021
2 parents 5ef7d5b + 1de61d2 commit fe05482
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
1 change: 1 addition & 0 deletions MouseJiggler/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions MouseJiggler/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// MouseJiggler - MainForm.cs
//
// Created by: Alistair J R Young (avatar) at 2021/01/20 7:23 PM.
// Created by: Alistair J R Young (avatar) at 2021/01/24 1:57 AM.

#endregion

Expand Down Expand Up @@ -47,9 +47,6 @@ private void MainForm_Load (object sender, EventArgs e)
{
if (this.JiggleOnStartup)
this.cbJiggling.Checked = true;

if (this.MinimizeOnStartup)
this.MinimizeToTray ();
}

private void UpdateNotificationAreaText ()
Expand Down Expand Up @@ -196,5 +193,19 @@ public int JigglePeriod
}

#endregion Settings properties

#region Minimize on start

private bool firstShown = true;

private void MainForm_Shown (object sender, EventArgs e)
{
if (this.firstShown && this.MinimizeOnStartup)
this.MinimizeToTray ();

this.firstShown = false;
}

#endregion
}
}
3 changes: 1 addition & 2 deletions MouseJiggler/MouseJiggler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
<Version>2.0.0</Version>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<PublishReadyToRun>true</PublishReadyToRun>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<Authors>Alistair J. R. Young</Authors>
<Company>Arkane Systems</Company>
<Description>A utility to continuously jiggle the mouse pointer to prevent screen saver activation.
Expand Down
8 changes: 7 additions & 1 deletion MouseJiggler/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// MouseJiggler - Program.cs
//
// Created by: Alistair J R Young (avatar) at 2021/01/20 7:23 PM.
// Created by: Alistair J R Young (avatar) at 2021/01/22 4:12 PM.

#endregion

Expand Down Expand Up @@ -45,9 +45,15 @@ public static int Main (string[] args)
if (instance.WaitOne (millisecondsTimeout: 0))

// Parse arguments and do the appropriate thing.
{
return Program.GetCommandLineParser ().Invoke (args: args);
}
else
{
Console.WriteLine (value: "Mouse Jiggler is already running. Aborting.");

return 1;
}
}
finally
{
Expand Down

0 comments on commit fe05482

Please sign in to comment.