Skip to content

Commit

Permalink
DeskTop: Fix type-down and tab selection if active window empty
Browse files Browse the repository at this point in the history
Follow-up to ea36d00 which violated the implicit assumption that the
set of "selectable icons" was non-empty. It can be, so explicitly
check and early-exit.
  • Loading branch information
inexorabletash committed Oct 9, 2024
1 parent ea36d00 commit a0b44c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 9 additions & 3 deletions desktop/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -3403,7 +3403,12 @@ next: lda #$00

;;; Figure out current selected index, based on selection.

common: lda selected_icon_count
common:
;; Anything selectable?
lda buffer
RTS_IF_EQ

lda selected_icon_count
beq pick_first

;; Try to find actual selection in our list
Expand Down Expand Up @@ -3506,9 +3511,10 @@ file_char:

;; Collect and sort the potential type-down matches
jsr GetNameSelectableIconsSorted
lda num_filenames
beq done

;; Find a match. There will always be one, since
;; desktop icons (including Trash) are considered.
;; Find a match.
jsr FindMatch

;; Icon to select
Expand Down
3 changes: 3 additions & 0 deletions res/notes/testplan.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@
* Clear selection. Press Shift+Tab repeatedly. Verify that icons in the active window (or desktop if no window is open) are selected in reverse lexicographic order.
* Select an icon. Press Shift+Tab. Verify that the previous icon in the active window (or desktop if no window is open) in lexicographic order is selected.

* Open a volume window containing no file icons. Clear selection by clicking on the desktop. Press Tab repeatedly. Verify selection does not change, scrollbars do not appear in the window, and DeskTop does not crash. Close the window. Verify that the volume icon is no longer dimmed.
* Open a volume window containing no file icons. Clear selection by clicking on the desktop. Type 'Z' repeatedly. Verify selection does not change, scrollbars do not appear in the window, and DeskTop does not crash. Close the window. Verify that the volume icon is no longer dimmed.


* Launch DeskTop. Open a volume containing no files. Verify that the default minimum window size is used - about 170px by 50px not counting title/scrollbars.

Expand Down

0 comments on commit a0b44c5

Please sign in to comment.