Skip to content

Commit

Permalink
Merge pull request #23 from mebibytedraco/fix-active-window-select
Browse files Browse the repository at this point in the history
Remove current window from list before choosing new active window in destroy_window
  • Loading branch information
ry755 authored Jul 16, 2023
2 parents b832aa8 + 84c3eab commit e368f2f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions kernel/window/window.asm
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ destroy_window:

mov r2, r0

; remove the window from the window list
call search_for_window_list_entry
mul r0, 4
add r0, window_list
mov [r0], 0

; set the active window to whatever entry is found first
call search_for_nonempty_window_list_entry
mov.8 [active_window_offset], r0
Expand All @@ -191,6 +197,7 @@ destroy_window:
call swap_windows

; set the menu bar for the newly active window
mov r0, r2
call get_window_menu_bar_root_struct
call enable_menu_bar
call clear_menu_bar
Expand All @@ -212,14 +219,6 @@ destroy_window_no_more_windows:
movz.8 r0, [r2]
call disable_overlay

; remove the window from the window list
sub r2, 24
mov r0, r2
call search_for_window_list_entry
mul r0, 4
add r0, window_list
mov [r0], 0

pop r2
pop r1
pop r0
Expand Down

0 comments on commit e368f2f

Please sign in to comment.