mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Set Windows HiDPI awareness (possible font aliasing fix)
This commit is contained in:
parent
7ab67c42dc
commit
99789758f1
1 changed files with 19 additions and 0 deletions
|
|
@ -41,6 +41,15 @@ using namespace std;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
|
||||||
|
|
||||||
|
enum MY_PROCESS_DPI_AWARENESS {
|
||||||
|
PROCESS_DPI_UNAWARE,
|
||||||
|
PROCESS_SYSTEM_DPI_AWARE,
|
||||||
|
PROCESS_PER_MONITOR_DPI_AWARE
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef HRESULT (WINAPI* SetProcessDpiAwareness_t)(MY_PROCESS_DPI_AWARENESS);
|
||||||
|
|
||||||
void
|
void
|
||||||
fixup_bundle_environment (int, char* [], string & localedir)
|
fixup_bundle_environment (int, char* [], string & localedir)
|
||||||
{
|
{
|
||||||
|
|
@ -89,6 +98,16 @@ fixup_bundle_environment (int, char* [], string & localedir)
|
||||||
* furthermore it'll be even less common for derived products.
|
* furthermore it'll be even less common for derived products.
|
||||||
*/
|
*/
|
||||||
Glib::setenv ("ARDOUR_SELF", Glib::build_filename(ardour_dll_directory(), "ardour.exe"), true);
|
Glib::setenv ("ARDOUR_SELF", Glib::build_filename(ardour_dll_directory(), "ardour.exe"), true);
|
||||||
|
|
||||||
|
/* https://docs.microsoft.com/en-us/windows/win32/api/shellscalingapi/nf-shellscalingapi-setprocessdpiawareness */
|
||||||
|
HMODULE module = LoadLibraryA ("Shcore.dll");
|
||||||
|
if (module) {
|
||||||
|
SetProcessDpiAwareness_t setProcessDpiAwareness = reinterpret_cast<SetProcessDpiAwareness_t> (GetProcAddress (module, "SetProcessDpiAwareness"));
|
||||||
|
if (setProcessDpiAwareness) {
|
||||||
|
setProcessDpiAwareness (PROCESS_SYSTEM_DPI_AWARE);
|
||||||
|
}
|
||||||
|
FreeLibrary (module);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static __cdecl void
|
static __cdecl void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue