Skip to content

Fixed issue with maximizing window on secondary monitors#157

Merged
batzen merged 5 commits intoControlzEx:developfrom
jizc:bugfix/fixed-maximize-on-left-monitor
Jun 29, 2022
Merged

Fixed issue with maximizing window on secondary monitors#157
batzen merged 5 commits intoControlzEx:developfrom
jizc:bugfix/fixed-maximize-on-left-monitor

Conversation

@jizc
Copy link
Copy Markdown
Contributor

@jizc jizc commented Jun 28, 2022

Describe the changes you have made to improve this project

This fixes an issue with maximizing a window on a monitor to the left of (or above) the main monitor. The root cause was the calculation of the right and bottom properties in the ToRECT method. This wrong calculation resulted in MonitorFromWindowPosOrWindow returning the wrong monitor, which in turn made _HandleNCCALCSIZE not work correctly.

Unit test

Added test called RectConvertedFromWindowPositionIsCorrectSize.

Additional context

Before the fix
before

After the fix
after

@punker76 punker76 requested review from batzen and punker76 June 28, 2022 11:41
Copy link
Copy Markdown
Member

@punker76 punker76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
/cc @batzen

@batzen batzen self-assigned this Jun 28, 2022
@batzen batzen added this to the 6.0.0 milestone Jun 28, 2022
@batzen batzen merged commit 5b9e25c into ControlzEx:develop Jun 29, 2022
@batzen
Copy link
Copy Markdown
Member

batzen commented Jun 29, 2022

@jizc Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants