Skip to content
Snippets Groups Projects
Commit a8e3de52 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

As it turns out, setting high DPI awareness in the process fails.

Presumably, "something" is setting it earlier so it can't be set
again because reasons.  To work around this, add a manifest to
ciolib library that asserts the binary is DPI aware and requests
Windows not do GDI scaling.

Not sure if manifest .o files in a lib are linked in by things, but
SyncTERM pulls the .o out and explicitly links it, so this should
fix SyncTERM at least.
parent 2848bf8f
No related branches found
No related tags found
No related merge requests found
Pipeline #5848 failed
......@@ -64,7 +64,7 @@ mtlib: $(MTOBJODIR)$(DIRSEP)ciolib_res${OFILE}
dl-mtlib: $(MTOBJODIR)$(DIRSEP)ciolib_res${OFILE}
$(MTOBJODIR)$(DIRSEP)ciolib_res${OFILE}: ciolib.rc syncicon64.ico
$(MTOBJODIR)$(DIRSEP)ciolib_res${OFILE}: ciolib.rc syncicon64.ico ciolib.manifest
@echo Creating $< ...
$(QUIET)${WINDRES} $(WINDRESFLAGS) -O coff -i ciolib.rc -o $@
endif
<?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</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor, System</dpiAwareness>
<gdiScaling xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">false</gdiScaling>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
#include "windows.h"
/* Manifest */
1 RT_MANIFEST "ciolib.manifest"
/* ========================================================================= */
/* Icons. */
/* ========================================================================= */
1 ICON "syncicon64.ico"
2 ICON "syncicon64.ico"
......@@ -1112,9 +1112,6 @@ gdi_init(int mode)
{
CreatePipe(&rch, &wch, NULL, 0);
bitmap_drv_init(gdi_drawrect, gdi_flush);
gdi_textmode(ciolib_initial_mode);
// code that tells windows we're High DPI aware so it doesn't scale our windows
// taken from Yamagi Quake II
......@@ -1161,6 +1158,9 @@ gdi_init(int mode)
else if (SetProcessDPIAware) {
SetProcessDPIAware();
}
bitmap_drv_init(gdi_drawrect, gdi_flush);
gdi_textmode(ciolib_initial_mode);
_beginthread(gdi_thread, 0, (void *)(intptr_t)mode);
WaitForSingleObject(init_sem, INFINITE);
CloseHandle(init_sem);
......
......@@ -99,7 +99,7 @@ ifeq ($(os),win32)
EXTRA_LIBS += -luuid
endif
$(MTOBJODIR)$(DIRSEP)ciolib_res$(OFILE):
$(MTOBJODIR)$(DIRSEP)ciolib_res$(OFILE): ${CIOLIB-MT}
cd ${MTOBJODIR} && $(AR) -x ../${CIOLIB-MT} ciolib_res$(OFILE)
$(SYNCTERM): $(CRYPT_DEPS) $(EXEODIR) $(OBJS) $(BUILD_DEPENDS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment