Linux: use X11 window manager events to move window and to show window menu (right-click on window title bar), if custom window decorations are enabled (issue #482)

This commit is contained in:
Karl Tauber
2022-08-20 21:09:49 +02:00
parent 16f3f9e6ff
commit fb4576fc1b
18 changed files with 769 additions and 59 deletions

View File

@@ -16,22 +16,19 @@
plugins {
`cpp-library`
`flatlaf-cpp-library`
`flatlaf-jni-headers`
}
flatlafJniHeaders {
headers = listOf(
"com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder.h",
"com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc.h"
)
}
library {
targetMachines.set( listOf( machines.windows.x86, machines.windows.x86_64 ) )
// disable debuggable for release builds to make shared libraries smaller
binaries.configureEach( CppSharedLibrary::class ) {
with( compileTask.get() ) {
if( name.contains( "Release" ) )
isDebuggable = false
}
with( linkTask.get() ) {
if( name.contains( "Release" ) )
debuggable.set( false )
}
}
}
var javaHome = System.getProperty( "java.home" )
@@ -43,36 +40,15 @@ tasks {
group = "build"
description = "Builds natives"
dependsOn( "linkReleaseX86", "linkReleaseX86-64" )
if( org.gradle.internal.os.OperatingSystem.current().isWindows() )
dependsOn( "linkReleaseX86", "linkReleaseX86-64" )
}
withType<CppCompile>().configureEach {
onlyIf { name.contains( "Release" ) }
// depend on :flatlaf-core:compileJava because it generates the JNI headers
dependsOn( ":flatlaf-core:compileJava" )
doFirst {
println( "Used Tool Chain:" )
println( " - ${toolChain.get()}" )
println( "Available Tool Chains:" )
toolChains.forEach {
println( " - $it" )
}
// copy needed JNI headers
copy {
from( project( ":flatlaf-core" ).buildDir.resolve( "generated/jni-headers" ) )
into( "src/main/headers" )
include(
"com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder.h",
"com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc.h"
)
filter<org.apache.tools.ant.filters.FixCrLfFilter>(
"eol" to org.apache.tools.ant.filters.FixCrLfFilter.CrLf.newInstance( "lf" )
)
}
}
// generate and copy needed JNI headers
dependsOn( "jni-headers" )
includes.from(
"${javaHome}/include",