Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for overflow exception (multi monitor) #1014

Merged
merged 2 commits into from
Feb 12, 2014
Merged

Fix for overflow exception (multi monitor) #1014

merged 2 commits into from
Feb 12, 2014

Conversation

zeluisping
Copy link
Contributor

If X and Y are both -1, the packed integer is 0xFFFFFFFF which is not a valid Int32, thus a System.OverflowException is thrown in IntPtr.ToInt32().

To fix this, IntPtr.ToInt64() is used instead.

Fixes #624

if x and y are both -1, the packed integer is 0xFFFFFFFF which is not a valid Int32, thus an overflow exception is thrown in IntPtr.ToInt32().
@AzureKitsune
Copy link
Member

@NickWard if you're still around, could you verify if this fixes your issue?

@zeluisping
Copy link
Contributor Author

@NickWard It will be hard to get the exception again, since it should only happen when both X and Y are -1.
You'll have to set your monitor configuration so that you get a point that has coordinates (-1,-1).

@AzureKitsune AzureKitsune mentioned this pull request Feb 12, 2014
AzureKitsune added a commit that referenced this pull request Feb 12, 2014
Fix for overflow exception (multi monitor)
@AzureKitsune AzureKitsune merged commit d022f57 into MahApps:master Feb 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants