From 6e9645915251e688cd7c0a0adbbdcce541e4cceb Mon Sep 17 00:00:00 2001 From: rubenpirreram Date: Thu, 21 May 2026 09:06:31 +0200 Subject: [PATCH] Fixed: Popup now disappear if the scene change --- .../it/polimi/ingsw/gc14/View/GUI/MainFXMLController.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainFXMLController.java b/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainFXMLController.java index d656ab0..47c6834 100644 --- a/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainFXMLController.java +++ b/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainFXMLController.java @@ -601,6 +601,12 @@ public class MainFXMLController { if(!isNowFocused) popup.hide(); }); + mainScene.getWindow().sceneProperty().addListener((obs, oldScene, newScene) -> { + if(newScene!=mainScene) + { + popup.hide(); + } + }); } private void showPopup() {