[libbluray-devel] Fix HScene.setVisible()

hpi1 git at videolan.org
Mon Mar 28 16:03:28 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Mar 28 16:55:18 2016 +0300| [7fdd333f81ac021b8dddd00c515a21b155fa71de] | committer: hpi1

Fix HScene.setVisible()

Other scenes were hidden, but visible state was never restored.
Fixes lost key focus with multi-HScene discs.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=7fdd333f81ac021b8dddd00c515a21b155fa71de
---

 src/libbluray/bdj/java/org/havi/ui/HScene.java |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/libbluray/bdj/java/org/havi/ui/HScene.java b/src/libbluray/bdj/java/org/havi/ui/HScene.java
index 96b9c38..905a4b2 100644
--- a/src/libbluray/bdj/java/org/havi/ui/HScene.java
+++ b/src/libbluray/bdj/java/org/havi/ui/HScene.java
@@ -382,15 +382,27 @@ public class HScene extends Container implements HComponentOrdering {
     }
 
     public void setVisible(boolean visible) {
+        if (visible == isVisible())
+            return;
         super.setVisible(visible);
+
+        /*
+         * This doesn't work
+         *  - visible state of other HScenes is never restored
+         *     => no focus, key events are lost
+         *  - Scenes are not wiped from GUI
+
         if (visible) {
             for (int i = 0; i < GUIManager.getInstance().getComponentCount(); i++) {
                     Component c = GUIManager.getInstance().getComponent(i);
                     if (c != this)
                         c.setVisible(false);
-    }
+            }
         }
-        GUIManager.getInstance().setVisible(visible);
+        */
+
+        if (visible)
+            GUIManager.getInstance().setVisible(visible);
     }
 
     public int getBackgroundMode() {



More information about the libbluray-devel mailing list