Skip to content

Commit

Permalink
fixed: app icon does not show on taskbar #1799, caused by the fix for #…
Browse files Browse the repository at this point in the history
  • Loading branch information
d2phap committed Dec 29, 2023
1 parent 55d0381 commit efcd8d2
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,17 @@ public static void SetPlacementToWindow(Form frm, WindowPlacement wp)

try
{
_ = SetWindowPlacement(frm.Handle, ref wp);

// Windows 10 hack: if taskbar is on top, the window position is not correct
// https://github.com/d2phap/ImageGlass/issues/1790
if (wp.showCmd == WindowState.Normal)
{
frm.SetBounds(wp.normalPosition.Left, wp.normalPosition.Top,
wp.normalPosition.Right - wp.normalPosition.Left,
wp.normalPosition.Bottom - wp.normalPosition.Top);
}
else
{
_ = SetWindowPlacement(frm.Handle, ref wp);
frm.SetBounds(
wp.normalPosition.Left,
wp.normalPosition.Top,
wp.normalPosition.Right - wp.normalPosition.Left,
wp.normalPosition.Bottom - wp.normalPosition.Top);
}
}
catch { }
Expand Down

0 comments on commit efcd8d2

Please sign in to comment.