Fixed: Popup now disappear if the window is not focused

This commit is contained in:
rubenpirreram
2026-05-21 08:53:25 +02:00
parent 424b143805
commit 9d1aa51afe
@@ -79,6 +79,7 @@ public class MainFXMLController {
@FXML
public void initialize() {
Font.loadFont(getClass().getResourceAsStream("/Fonts/InknutAntiqua-Regular.ttf"), 14);
popup = new Popup();
mainHBox.sceneProperty().addListener((obs, oldScene, newScene) -> {
if (newScene != null) {
newScene.getRoot().applyCss();
@@ -589,7 +590,6 @@ public class MainFXMLController {
"-fx-background-radius: 10;"
);
popup = new Popup();
popup.getContent().add(popupCards);
popup.setAutoHide(false); // gestito manualmente per permettere click sulle carte
popup.addEventHandler(Event.ANY, e -> {