aboutsummaryrefslogtreecommitdiff
path: root/src/mingwMain/kotlin/moe/yuuta/aero/WinCompat.kt
diff options
context:
space:
mode:
authorYuutaW <17158086+Trumeet@users.noreply.github.com>2019-07-01 14:43:07 -0700
committerTrumeet <17158086+Trumeet@users.noreply.github.com>2019-07-01 14:43:07 -0700
commit3c3c4841312262c73c5d973d590f541f8445962d (patch)
treec0e39367c1b60344182bdaf5e66c4acff114335a /src/mingwMain/kotlin/moe/yuuta/aero/WinCompat.kt
parent41b0c65a084619330db2ead75cffe7fbe6db9ad8 (diff)
downloadAero-3c3c4841312262c73c5d973d590f541f8445962d.tar
Aero-3c3c4841312262c73c5d973d590f541f8445962d.tar.gz
Aero-3c3c4841312262c73c5d973d590f541f8445962d.tar.bz2
Aero-3c3c4841312262c73c5d973d590f541f8445962d.zip
feat: add support for Windows 7 Aero APIHEADuntagged-edcb449b8928f4456e7cmaster
Breaking changes: To test on the Windows 7 x86 virtual machine, the build had been changed from mingwX64 to mingwX86. Therefore the binary path will be changed, INT_PTR will represent Int and some Gradle tasks disappeared and changed. Due to the change of INT_PTR and some unknown reasons, the dialog cannot be shown so I removed the dialog mode. Signed-off-by: Trumeet <17158086+Trumeet@users.noreply.github.com>
Diffstat (limited to 'src/mingwMain/kotlin/moe/yuuta/aero/WinCompat.kt')
-rw-r--r--src/mingwMain/kotlin/moe/yuuta/aero/WinCompat.kt9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mingwMain/kotlin/moe/yuuta/aero/WinCompat.kt b/src/mingwMain/kotlin/moe/yuuta/aero/WinCompat.kt
index 29c78fb..029e9a2 100644
--- a/src/mingwMain/kotlin/moe/yuuta/aero/WinCompat.kt
+++ b/src/mingwMain/kotlin/moe/yuuta/aero/WinCompat.kt
@@ -3,6 +3,7 @@ package moe.yuuta.aero
import kotlinx.cinterop.*
import platform.windows.GetModuleHandleA
import platform.windows.GetStartupInfoA
+import platform.windows.WINBOOLVar
import platform.windows._STARTUPINFOA
object WinCompat {
@@ -16,4 +17,12 @@ object WinCompat {
}
val hInstance
get() = GetModuleHandleA(null)
+
+ fun DwmIsCompositionEnabled(): Boolean {
+ val enable = nativeHeap.alloc<WINBOOLVar>()
+ platform.windows.DwmIsCompositionEnabled(enable.ptr)
+ val result = enable.value
+ nativeHeap.free(enable)
+ return result > 0
+ }
} \ No newline at end of file