Skip to content

Commit

Permalink
Swing interop: off-screen rendering on graphics (#601)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Ivan Matkov <[email protected]>
  • Loading branch information
Walingar and MatkovIvan authored Jul 3, 2023
1 parent 694757a commit 0f8192c
Show file tree
Hide file tree
Showing 7 changed files with 483 additions and 265 deletions.
10 changes: 10 additions & 0 deletions compose/desktop/desktop/samples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ task runSwing(type: JavaExec) {
compilation.runtimeDependencyFiles
}

task runSwingOffscreenRendering(type: JavaExec) {
dependsOn(":compose:desktop:desktop:jar")
main = "androidx.compose.desktop.examples.swingexample.Main_jvmKt"
def compilation = kotlin.jvm().compilations["main"]
classpath =
compilation.output.allOutputs +
compilation.runtimeDependencyFiles
jvmArgs("-Dcompose.swing.render.on.graphics=true")
}

task runMouseClicks(type: JavaExec) {
dependsOn(":compose:desktop:desktop:jar")
main = "androidx.compose.desktop.examples.mouseclicks.Main_jvmKt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ fun SwingComposeWindow() {
size = IntSize(40, 40),
action = {
panel.remove(composePanelBottom)
panel.revalidate()
panel.repaint()
}
),
BorderLayout.SOUTH
Expand Down
Loading

0 comments on commit 0f8192c

Please sign in to comment.