gluonhq / gluon-samples

Gluon sample projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Placing image on Clipboard crashes app on iOS simulator or iPad

husonlab opened this issue · comments

Placing an image on the Clipboard causes app to crash on iOS simulator or iPad (but works fine on MacBookPro).

To reproduce, add a copy button to the gluon-samples DoddleTrace.java using these lines:

import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
var copyActionButton = new FloatingActionButton(MaterialDesignIcon.CONTENT_COPY.text, e -> {
	var image = this.getCenter().snapshot(null, null);
	var content = new ClipboardContent();
	content.putImage(image);
	Clipboard.getSystemClipboard().setContent(content);
});
copyActionButton.showOn(this);

Start the App:

mvn -Pios-sim gluonfx:build gluonfx:package gluonfx:install gluonfx:nativerun

When running, press the copy button. The app closes down and something like this appears in the
console:

[Thu Jan 11 21:43:05 CET 2024][INFO] [SUB] com.gluonhq.samples.doodle-trace: 85415

The crash log contains this: Termination Reason: SIGNAL 11 Segmentation fault: 11