Hey guys,
now that I've learned about DPI Aware(ness) scaling and how to set those settings in a manifest file for Visual Studio (see this thread for more:
viewtopic.php?f=1&t=43968), I discovered new issues with DPI Awareness.
Atm I compile my project with VS2015, which automatically sets DPI Awareness (if enabled), so that my GUI doesnt fill the whole screen (or more even), when the user sets a scaling. But my project also contains a context menu (in this case from a tray icon) and this menu is also scaled back with DPI Awareness. Then again, no other program does that, and if the user zooms in to see better, I do not want my text-based menu to be so small.
Is there a way to EXCLUDE my context menu from DPI Awareness? After all, the awareness is set globally (via manifest) and I wouldn't know how to start with this. I can't turn it off completely, because my GUI needs it.
Any ideas or do you know, where I should start looking?
Greetings
Natu
Exclude Context Menus from DPI Awareness Topic is solved
Re: Exclude Context Menus from DPI Awareness
Hi,
You probably better off posting to the wx-dev ML.
Especially if no other program does it....
Just mention you OS and have some screenshots for your application and some other.
Also - keep in mind that the DPI Awareness is not yet finalized - there might still be some changes. But it is better to do that before the next release.
Thank you.
You probably better off posting to the wx-dev ML.
Especially if no other program does it....
Just mention you OS and have some screenshots for your application and some other.
Also - keep in mind that the DPI Awareness is not yet finalized - there might still be some changes. But it is better to do that before the next release.
Thank you.
Re: Exclude Context Menus from DPI Awareness
As Igor said, DPI Awareness in wxWidgets is still a work in development.
See for example this discussion: https://groups.google.com/forum/#!topic ... 0cIJBC92Dg
You can set a font size depending on the current DPI and size (by calling wxGetDisplayPPI and wxDisplaySizeMM). But we aware wx may do its thing too in a near future (wx3.2 ?).
See for example this discussion: https://groups.google.com/forum/#!topic ... 0cIJBC92Dg
You can set a font size depending on the current DPI and size (by calling wxGetDisplayPPI and wxDisplaySizeMM). But we aware wx may do its thing too in a near future (wx3.2 ?).
Re: Exclude Context Menus from DPI Awareness
Thank you guys,
I wasn't aware that it is in developement. I had some issues with DPI awareness already, like checkboxes cut off at the top or a sizer not caring about a border size.
Still, there are more and more high DPI displays (like 4k monitor) and I was happy to have at least something.
EDIT:
Do you know of a possibility to increase the size of a context menu as a workaround? I could maybe catch the "WM_DPICHANGED message" myself and react to it.
Thanks for your time anyway.
Natu
I wasn't aware that it is in developement. I had some issues with DPI awareness already, like checkboxes cut off at the top or a sizer not caring about a border size.
Still, there are more and more high DPI displays (like 4k monitor) and I was happy to have at least something.
EDIT:
Do you know of a possibility to increase the size of a context menu as a workaround? I could maybe catch the "WM_DPICHANGED message" myself and react to it.
Thanks for your time anyway.
Natu
Re: Exclude Context Menus from DPI Awareness
I gotta say, I dont really know what it was but I think Ive got a solution here.
I created two manifest, which I add to my project (Add Existing File). I used to include manifest files in the settings via "additional manifest files" before which should do the same, but who knows.
The manifests are:
Compatibility_Manifest.manifest
DPI_Manifest.manifest
Note: GdiScaling did no good for me, so I had it commented out lastly.
Though, the compiler has a complaint:
Additionally, in the settings, I set the following:
Edit: As far as I can see, I was a little early. The menu itself isnt scaled, but the submenus of that menu are. Strange that. (Win10 only, no different scaling under VM-Win7x64)
Have a great day
Natu
I created two manifest, which I add to my project (Add Existing File). I used to include manifest files in the settings via "additional manifest files" before which should do the same, but who knows.
The manifests are:
Compatibility_Manifest.manifest
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
</assembly>
Code: Select all
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0' xmlns:asmv3='urn:schemas-microsoft-com:asm.v3'>
<asmv3:application>
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<!-- fallback for Windows 7 and 8 -->
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness>
<!-- falls back to per-monitor if per-monitor v2 is not supported -->
<!--gdiScaling xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">true</gdiScaling-->
<!-- enables GDI DPI scaling -->
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
Though, the compiler has a complaint:
But it doesn't hurt either. And actually, that or compatibility is what helped me scale the menues right.DPI_Manifest.manifest : manifest authoring warning 81010002: Unrecognized Element "dpiAwareness" in namespace "http://schemas.microsoft.com/SMI/2016/WindowsSettings".
Additionally, in the settings, I set the following:
Good luck if you run into this issue.Generate Manifest: yes
Embed Manifest: Yes
DPI Awareness: None
Edit: As far as I can see, I was a little early. The menu itself isnt scaled, but the submenus of that menu are. Strange that. (Win10 only, no different scaling under VM-Win7x64)
Have a great day
Natu
Re: Exclude Context Menus from DPI Awareness
Hi Natu,
the wx.rc does include the manifest.wx file.
Would it not be better to modify the
include/wx/msw/manifest.wx
file?
Or How can I include my own project dependent manifest?
Any help is very appreciated.
the wx.rc does include the manifest.wx file.
Would it not be better to modify the
include/wx/msw/manifest.wx
file?
Or How can I include my own project dependent manifest?
Any help is very appreciated.