EVT_TREE_STATE_IMAGE_CLICK() and the second monitor Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Alan Stewart
Knows some wx things
Knows some wx things
Posts: 44
Joined: Wed Jul 08, 2015 2:19 pm

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by Alan Stewart »

Oh, and thank you all.
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by rocrail »

doublemax wrote: Thu May 02, 2019 6:07 pm Is your app marked as "DPI aware" through the manifest?
how to? In which part of the wxWidgets Application?
Best regards,
Rob.
https://wiki.rocrail.net
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7479
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by ONEEYEMAN »

Hi,
It is inside the manifest.

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by doublemax »

rocrail wrote: Fri May 24, 2019 8:10 pm
doublemax wrote: Thu May 02, 2019 6:07 pm Is your app marked as "DPI aware" through the manifest?
how to? In which part of the wxWidgets Application?
This is only relevant under Windows, and it's done through the application manifest file.
https://docs.microsoft.com/en-us/window ... -manifests
Use the source, Luke!
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by rocrail »

wxWidgets has a wx.manifest in the source tree which is included by wx.rc.
Which lines must I add or change?
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by rocrail »

Something like this?

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
    <assemblyIdentity type="win32" name="MyApplication" version="1.0.0.0" processorArchitecture="amd64"/>

    <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>
https://stackoverflow.com/questions/235 ... -to-per-mo
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by doublemax »

wxWidgets doesn't support per-monitor DPI yet, so you shouldn't set that.

I'm not sure what the "gdiScaling" settings does exactly, but based on its description, i wouldn't set it either.
Use the source, Luke!
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by rocrail »

I need a way to prevent Windows to scale my application which looks ugly and is not wanted.
Is there a way in wxWidgets to prevent this instead of in a manifest?
With the 3.0 branch it was not scaled, so it has definitively something todo with 3.1.

GDI Scaling I already removed.
The build process with the manifest is pending. I will report after its finished.
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by rocrail »

It does not help.
wxWidgets 3.0 is aware and 3.1 is unaware... :(
I cannot go back to 3.0...
Attachments
3.1.3_unaware.PNG
3.0.5.aware.PNG
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by rocrail »

It seems to be a break between 3.0 and 3.1
https://docs.wxwidgets.org/3.0/group__g ... 55b291e569
void wxMSWDisableSettingHighDPIAware ( )
Prevents wxWidgets from setting HighDPI awareness mode.

wxEntry calls SetDPIProcessAware() early during initialization on Windows. To prevent this (e.g. because wx is embedded in native code and disabling DPI awareness in the manifest is not an option), call this function before* wxEntry() is called.

Availability: only available for the wxMSW port.
Include file:

#include <wx/init.h>
Since
3.0.3, but only available in 3.0.x, not 3.1+ which doesn't make the SetDPIProcessAware() call anymore.

in 3.0:

Code: Select all

interface/wx/init.h:    wxEntry calls SetDPIProcessAware() early during initialization on Windows.
interface/wx/init.h:           the SetDPIProcessAware() call anymore.
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by rocrail »

How can I call SetDPIProcessAware() in my wxWidgets App?
In the App constructor?

Code: Select all

RocGui::RocGui():wxApp() {
  wxSetEnv(wxT("UBUNTU_MENUPROXY"), wxT("0"));
#ifdef windows
  SetDPIProcessAware();
#endif
}

Best regards,
Rob.
https://wiki.rocrail.net
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by doublemax »

Don't do this, use the manifest. There is a reason why that call was removed.

If it didn't work with 3.1, something must be wrong with either the manifest or how it was embedded.

BTW: What compiler do you use under Windows? If you're using Visual Studio, there are settings for this under "Manifest tools".
Use the source, Luke!
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: EVT_TREE_STATE_IMAGE_CLICK() and the second monitor

Post by rocrail »

Can you please move the postings to the new thread
viewtopic.php?f=1&t=45915
because this thread is flagged as solved.
Best regards,
Rob.
https://wiki.rocrail.net
Post Reply