diff --git a/kernel/window/event_manager_task.asm b/kernel/window/event_manager_task.asm index 99bb6bd..b77927d 100644 --- a/kernel/window/event_manager_task.asm +++ b/kernel/window/event_manager_task.asm @@ -35,6 +35,8 @@ event_manager_task_loop: ifz call add_event_to_active_window cmp r0, EVENT_TYPE_MENU_CLICK ifz call add_event_to_active_window + cmp r0, EVENT_TYPE_MENU_ACK + ifz call add_event_to_active_window cmp r0, EVENT_TYPE_MENU_UPDATE ifz call add_event_to_active_window @@ -58,6 +60,18 @@ event_manager_task_mouse_event: push r1 push r2 + ; if a menu is open, don't continue + ; this is hacky as fuck + push r0 + in r0, 0x8000031D ; overlay 29: enable status + cmp r0, 0 + ifnz pop r0 + ifnz pop r2 + ifnz pop r1 + ifnz pop r0 + ifnz ret + pop r0 + ; find which overlay was clicked on mov r0, r1 mov r1, r2 diff --git a/kernel/window/overlay.asm b/kernel/window/overlay.asm index 7739339..7513020 100644 --- a/kernel/window/overlay.asm +++ b/kernel/window/overlay.asm @@ -2,7 +2,7 @@ ; given a position on screen, find which enabled overlay (if any) is covering it ; if multiple overlays are covering the same position, the highest priority one will be returned -; overlay 31 (the mouse cursor) is ignored +; overlays 31, 30, and 29 (mouse cursor, menu bar, menu) are ignored ; inputs: ; r0: X coordinate ; r1: Y coordinate @@ -12,7 +12,7 @@ find_overlay_convering_position: push r2 push r31 - mov r31, 31 + mov r31, 29 find_overlay_convering_position_loop: mov r2, r31 dec r2