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

Use DpiAwarenessContext.SystemAware when creating Tool Windows. #934

Merged
merged 1 commit into from
Jun 20, 2019

Conversation

lajones
Copy link
Contributor

@lajones lajones commented Jun 20, 2019

Fix for internal bug 898367 and #788 - Model Browser not visible.

This only happens (for me) on some screens, and then only for some combinations of screen resolution and scale factor. It could be worked around by unchecking Tools -> Options -> Environment -> General -> Optimize rendering for screens with different pixel densities, but this fix should make that unnecessary.

@lajones lajones self-assigned this Jun 20, 2019
Copy link
Contributor

@divega divega left a comment

Choose a reason for hiding this comment

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

Added code to handle the issue looks good. I just have a couple of questions about some of the secondary changes.

@@ -66,11 +69,15 @@
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0" />
<Reference Condition="'$(VisualStudioVersion)' != '11.0' AND '$(VisualStudioVersion)' != '12.0' AND '$(VisualStudioVersion)' != '14.0'"
Include="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime" />
<Reference Condition="'$(VisualStudioVersion)' == '16.0'" Include="Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime, Version=14.0.0.0">
Copy link
Contributor

Choose a reason for hiding this comment

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

I am a bit surprised that we pull the 14.0 version of the assemblies for the 16.0 version of VS? Shouldn't the major version numbers match?

Also, is it ok to have Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime (per the previous line) and Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime added as references at the same time? It seems both conditions apply if the version of VS is 16.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The 14.0 version is required in the fix published by the PMA team for this (which is specifically for 16.0 VS onwards). I agree that 15.3 and 14.0 is weird but does not appear to cause any problems and taking out 15.3 would require extensive re-testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And note, 15.3 by itself did not work.

@@ -109,6 +110,7 @@ public ITextTemplatingSession CreateSession()
return new TextTemplatingSession();
}

[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious, what object is disposable here? Engine? Asking because the warning may be flagging an actual bug in our code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, Engine. That code has been like that for multiple major versions - so it's stable and I'd rather not destabilize it while trying to fix this urgent issue. Plus we have many suppressions like this - so it's a more general task to go through the code and remove them.

@lajones lajones merged commit 2e0ba78 into 190313_Dev16_MicroBuild_07 Jun 20, 2019
@ghost ghost deleted the 190612_PMA_bugs_01 branch June 20, 2019 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants