Skip to content

Commit

Permalink
Merge pull request #30 from OliveIsAWord/main
Browse files Browse the repository at this point in the history
`event_manager_task_loop` now exhausts event queue
  • Loading branch information
ry755 authored Oct 9, 2024
2 parents 3d1c398 + 3ea882b commit 4089c1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions applications/terminal/main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ event_loop_end:
mouse_down:
; check if we are attempting to drag or close the window
cmp r2, 16
iflteq jmp drag_window
iflt jmp drag_window

jmp event_loop_end

Expand Down Expand Up @@ -98,7 +98,7 @@ key_up:

drag_window:
cmp r1, 8
iflteq jmp event_loop_end
iflt jmp close_window
mov r0, window_struct
call start_dragging_window
jmp event_loop_end
Expand Down
4 changes: 4 additions & 0 deletions kernel/window/event_manager_task.asm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ event_manager_task_loop:
ifz call add_event_to_active_window
cmp r0, EVENT_TYPE_KEY_UP
ifz call add_event_to_active_window

; keep adding events until the queue is exhausted
cmp r0, EVENT_TYPE_EMPTY
ifnz jmp event_manager_task_loop
event_manager_task_loop_end:
call yield_task
rjmp event_manager_task_loop
Expand Down

0 comments on commit 4089c1c

Please sign in to comment.