Skip to content

Commit

Permalink
fix first launch position being off when there are a lot of accounts …
Browse files Browse the repository at this point in the history
…added
  • Loading branch information
DubbleClick committed May 13, 2023
1 parent 0600d17 commit 37605b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
13 changes: 4 additions & 9 deletions GW Launcher/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected override void SetVisibleCore(bool value)
if (!_allowVisible)
{
value = false;
if (!this.IsHandleCreated) CreateHandle();
if (!IsHandleCreated) CreateHandle();
}
base.SetVisibleCore(value);
}
Expand Down Expand Up @@ -275,14 +275,7 @@ private void MainForm_Deactivate(object sender, EventArgs e)
private void NotifyIcon_MouseClick(object sender, MouseEventArgs e)
{
_allowVisible = true;
if (e.Button == MouseButtons.Right && Visible == false)
{
_keepOpen = true;
}
else
{
_keepOpen = false;
}
_keepOpen = e.Button == MouseButtons.Right && Visible == false;

bool IsVisible(Point p)
{
Expand All @@ -292,6 +285,8 @@ bool IsVisible(Point p)
var rect = NotifyIconHelper.GetIconRect(notifyIcon);
var position = new Point(rect.Left, rect.Top);

RefreshUI();

position.X -= Width / 2;
if (position.Y > Screen.FromPoint(Cursor.Position).WorkingArea.Height / 2)
{
Expand Down
4 changes: 2 additions & 2 deletions GW Launcher/GW Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<Platforms>x86;AnyCPU</Platforms>
<PlatformTarget>x86</PlatformTarget>
<DebugType>portable</DebugType>
<AssemblyVersion>13.8</AssemblyVersion>
<FileVersion>13.8</FileVersion>
<AssemblyVersion>13.9</AssemblyVersion>
<FileVersion>13.9</FileVersion>
<Copyright>2015-2023 GregLando113</Copyright>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
</PropertyGroup>
Expand Down

0 comments on commit 37605b6

Please sign in to comment.