[Ttssh2-commit] [7594] 高DPI対応enable/disableをiniファイルでできるようにした

アーカイブの一覧に戻る
scmno****@osdn***** scmno****@osdn*****
2019年 4月 18日 (木) 00:09:14 JST


Revision: 7594
          https://osdn.net/projects/ttssh2/scm/svn/commits/7594
Author:   zmatsuo
Date:     2019-04-18 00:09:14 +0900 (Thu, 18 Apr 2019)
Log Message:
-----------
高DPI対応enable/disableをiniファイルでできるようにした

Modified Paths:
--------------
    trunk/CMakeLists.txt
    trunk/teraterm/teraterm/teraterm.cpp
    trunk/teraterm/teraterm/vtwin.cpp

-------------- next part --------------
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2019-04-17 15:08:59 UTC (rev 7593)
+++ trunk/CMakeLists.txt	2019-04-17 15:09:14 UTC (rev 7594)
@@ -3,7 +3,6 @@
 
 project(teraterm_all)
 
-option(ENABLE_DPIAWARENESS "Dpiawareness" ON)
 option(ENABLE_TTXSAMPLES "TTXSamples" ON)
 option(USE_UNICODE_API "unicode" OFF)
 
@@ -32,7 +31,8 @@
   set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GF /Gy")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
-  if(${CMAKE_GENERATOR} MATCHES "Visual Studio 15 2017")
+  if(${MSVC_VERSION} GREATER_EQUAL 1910)
+    # Visual Studio 2017以上の時
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /ZI")
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /ZI")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")

Modified: trunk/teraterm/teraterm/teraterm.cpp
===================================================================
--- trunk/teraterm/teraterm/teraterm.cpp	2019-04-17 15:08:59 UTC (rev 7593)
+++ trunk/teraterm/teraterm/teraterm.cpp	2019-04-17 15:09:14 UTC (rev 7594)
@@ -110,13 +110,6 @@
 #endif
 	DLLInit();
 	WinCompatInit();
-#if defined(DPIAWARENESS)
-	//SetProcessDPIAware();
-	if (pSetThreadDpiAwarenessContext != NULL) {
-		// Windows 10 Version 1703\x88ȍ~\x82̏ꍇ?
-		pSetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
-	}
-#endif
 	LoadSpecialFont();
 }
 

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2019-04-17 15:08:59 UTC (rev 7593)
+++ trunk/teraterm/teraterm/vtwin.cpp	2019-04-17 15:09:14 UTC (rev 7594)
@@ -767,6 +767,18 @@
 	}
 	FreeTTSET();
 
+	// DPI Aware (\x8D\x82DPI\x91Ή\x9E)
+	{
+		int dip_aware = 0;
+		dip_aware = GetPrivateProfileInt("Tera Term", "DPIAware", dip_aware, ts.SetupFName);
+		if (dip_aware != 0) {
+			if (pSetThreadDpiAwarenessContext != NULL) {
+				// TODO Windows 10 Version 1703\x88ȍ~\x82̃`\x83F\x83b\x83N\x82\xF0\x93\xFC\x82\xEA\x82\xE9\x82ׂ\xAB\x82\xA9?
+				pSetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
+			}
+		}
+	}
+
 	// duplicate session\x82̎w\x92肪\x82\xA0\x82\xE9\x82Ȃ\xE7\x81A\x8B\xA4\x97L\x83\x81\x83\x82\x83\x8A\x82\xA9\x82\xE7\x83R\x83s\x81[\x82\xB7\x82\xE9 (2004.12.7 yutaka)
 	if (ts.DuplicateSession == 1) {
 		CopyShmemToTTSet(&ts);


Ttssh2-commit メーリングリストの案内
アーカイブの一覧に戻る