Skip to content

Commit

Permalink
Mouse Jump] - replace use of System.Windows.Forms.SystemInformation w…
Browse files Browse the repository at this point in the history
…ith Native Methods (microsoft#25482)
  • Loading branch information
mikeclayton committed Apr 13, 2023
1 parent a9e166a commit df70a09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modules/MouseUtils/MouseJumpUI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ private void Thumbnail_Click(object sender, EventArgs e)
if (mouseEventArgs.Button == MouseButtons.Left)
{
// plain click - move mouse pointer
var virtualScreen = ScreenHelper.GetVirtualScreen();
var scaledLocation = MouseHelper.GetJumpLocation(
new PointInfo(mouseEventArgs.X, mouseEventArgs.Y),
new SizeInfo(this.Thumbnail.Size),
new RectangleInfo(SystemInformation.VirtualScreen));
virtualScreen);
Logger.LogInfo($"scaled location = {scaledLocation}");
MouseHelper.JumpCursor(scaledLocation);

Expand Down Expand Up @@ -112,7 +113,7 @@ private static LayoutInfo GetLayoutInfo(MainForm form)
.Index;

var layoutConfig = new LayoutConfig(
virtualScreenBounds: new(SystemInformation.VirtualScreen),
virtualScreenBounds: ScreenHelper.GetVirtualScreen(),
screens: screens.Select(item => item.Screen).ToList(),
activatedLocation: activatedLocation,
activatedScreenIndex: activatedScreenIndex,
Expand Down

0 comments on commit df70a09

Please sign in to comment.