[libbluray-devel] Do not allow user input when menu is not visible.

hpi1 git at videolan.org
Mon Feb 21 14:30:03 CET 2011


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Feb 20 17:36:02 2011 +0200| [b5a04204b01bb4c9c3bf0bf71f57125a85bee1b1] | committer: hpi1

Do not allow user input when menu is not visible.

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

 src/libbluray/decoders/graphics_controller.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/libbluray/decoders/graphics_controller.c b/src/libbluray/decoders/graphics_controller.c
index 30ed7bb..6007860 100644
--- a/src/libbluray/decoders/graphics_controller.c
+++ b/src/libbluray/decoders/graphics_controller.c
@@ -446,6 +446,10 @@ static int _user_input(GRAPHICS_CONTROLLER *gc, bd_vk_key_e key, GC_NAV_CMDS *cm
         TRACE("_user_input(): popup menu not visible\n");
         return -1;
     }
+    if (!gc->ig_drawn) {
+        ERROR("_user_input(): menu not visible\n");
+        return -1;
+    }
 
     TRACE("_user_input(%d)\n", key);
 
@@ -508,7 +512,7 @@ static int _user_input(GRAPHICS_CONTROLLER *gc, bd_vk_key_e key, GC_NAV_CMDS *cm
     }
 
     /* render page ? */
-    if (new_btn_id != cur_btn_id || activated_btn_id >= 0 || !gc->ig_drawn) {
+    if (new_btn_id != cur_btn_id || activated_btn_id >= 0) {
 
         bd_psr_write(gc->regs, PSR_SELECTED_BUTTON_ID, new_btn_id);
 
@@ -720,6 +724,11 @@ static int _mouse_move(GRAPHICS_CONTROLLER *gc, unsigned x, unsigned y, GC_NAV_C
 
     gc->valid_mouse_position = 0;
 
+    if (!gc->ig_drawn) {
+        ERROR("_mouse_move(): menu not visible\n");
+        return -1;
+    }
+
     page = _find_page(&s->ics->interactive_composition, page_id);
     if (!page) {
         ERROR("_mouse_move(): unknown page #%d (have %d pages)\n",



More information about the libbluray-devel mailing list