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

Make themes DPI aware #376

Closed

Conversation

jozefizso
Copy link
Contributor

@jozefizso jozefizso commented Aug 25, 2016

I've updated theme loader to scale UI elements at load time to the DPI level of primary monitor.
I've ported the splashcreen code from wixtoolset/wix#46

The burn.exe is marked as DPI aware. Loading the DPI of primary monitor should be sufficient for general use. I could not make the rescaling based on current monitor. I tested the built-in themes and they worked correctly.

I also updated thmviewer.exe to support high DPI monitors.

There may be some quirks in the implementation. This fixes the wixtoolset/issues#3920

@rseanhall
Copy link
Contributor

Thanks for the pull request. Although this bug was triaged for v3.x, the scope of this means that we need to get it into v4 first (this is reminding us that the Burn engine has GDI+ in v4 and we might not have fully tested that for the DLL hijacking issue, plus marking the exe as high-DPI aware might cause display issues in existing BA's). Please submit a new pull request for this in the wix4 repo.

A quick glance over the code shows a couple of style nits. According to the style guide, all local variables should be declared and initialized at the top of the function and there should be only one return statement from a function.

@barnson
Copy link
Member

barnson commented Aug 27, 2016

I'd rather not take GDI+ into the engine in v3. Other than splash screen, is there any hidpi functionality we lose without it? The ThmUtil change is great; I'll review that part soon(ish).

@jozefizso
Copy link
Contributor Author

The high DPI works even without that change to splash screen so this should not require GDI+.

@glopesdev
Copy link

Any updates on this pull request? It would be great to have high DPI support on wix v3, given the fast increasing number of devices that make use of it. Given that apparently no GDI+ support is needed, is there anything else holding this back?

Copy link
Member

@barnson barnson left a comment

Choose a reason for hiding this comment

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

Either of us can remove Heath's commit to avoid GDI+ in the engine. The other changes are fairly trivial. Sorry for the delay; this one required way too much spelunking in GDI to understand the code for getting per-monitor DPI in a backward-compatible manner. It sucks that's the easiest way and all the good functions were added in Windows 8.1 and 10. :)

GetDpiForMonitor - returns the X and Y DPI values for specified monitor.

********************************************************************/
BOOL DAPI GetDpiForMonitor(
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't really belong in GdipUtil. How about a new DpiUtil? Make this DpiGetForWindow?

GetScaleFactorForDpi - returns the scale factor for given DPI resolution.

********************************************************************/
FLOAT DAPI GetScaleFactorForDpi(
Copy link
Member

Choose a reason for hiding this comment

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

DpiGetScaleFactor?

@@ -550,6 +554,11 @@ DAPI_(void) ThemeSetFocus(
__in DWORD dwControl
);

DAPI_(int) ScaleByFactor(
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be public? If so, needs a Thm prefix.

@barnson
Copy link
Member

barnson commented Jan 2, 2017

Oh, and can you add a .md file in the history directory instead of editing history.md directly? That'll avoid the merge conflict.

@barnson barnson modified the milestone: v3.11 Feb 28, 2017
@barnson barnson added the moveto5 Consider moving feature to WiX v5 label Mar 28, 2017
@barnson barnson closed this Mar 28, 2017
@rakeshsinghranchi
Copy link

@barnson ,What version of wixtoolset should one use to consume this fix ? Thanks.

@barnson
Copy link
Member

barnson commented Feb 7, 2018

It hasn't been merged.

@rakeshsinghranchi
Copy link

Is there a timeline planned to merge this fix?

@livarcocc
Copy link

pinging on this thread. When will we have a wixtoolset version with this fix in it?

@barnson
Copy link
Member

barnson commented Nov 27, 2018

The engine changes are already present in WiX v4. The ThmUtil changes can be merged in WiX v4 when the open issues are addressed.

@rakeshsinghranchi
Copy link

cc @merriemcgaw

@johnbeisner
Copy link

@robmen
@barnson
A comment from wixtoolset/issues#3920 related to Hi-DPI support of themes:
"Bug is open in v3.x which means it's waiting for someone to step up and declare interest to fix it in a particular WiX v3 release."

And I see that someone has indeed stepped up:
@jozefizso
PR: #376

When can we see Hi-DPI support in WiX 3 or WiX 4? Can we get a general ETA so we can plan accordingly.

@barnson
Copy link
Member

barnson commented Mar 15, 2019

As I mentioned before, there are still open issues so it hasn't been merged. This PR is tagged moveto4 to look at doing that work before WiX v4.0 ships.

@livarcocc
Copy link

hey @barnson thanks for getting back to us. Where can I find information regarding when WiX v4.0 is shipping? Also, if there is something we can do to help address some of those issues, would love to help.

@barnson
Copy link
Member

barnson commented Mar 16, 2019

@livarcocc, WiX v4 is still in active development, so we don't have useful dates yet beyond "this year." If you wanted to port the change in this PR to https://github.com/wixtoolset/dutil and address the issues I raised above, they'd be available sooner than "when I have the spare time."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
moveto5 Consider moving feature to WiX v5
Projects
None yet
9 participants