Skip to content

Commit

Permalink
DeskTop: Fix parent selection when using Apple+Up
Browse files Browse the repository at this point in the history
When activating a volume window, the volume icon would be selected,
either causing a selection flash or, after a recent refactor not
cleared at all. Tweak the logic to just not highlight the volume icon
in this activation path.

This was noted in issue #576.
  • Loading branch information
inexorabletash committed Oct 2, 2021
1 parent f11f8f6 commit 9839082
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions desktop/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -559,35 +559,37 @@ not_menu:
;;; ============================================================
;;; Inputs: window id to activate in `findwindow_window_id`

;;; Activate the window, and sets selection to its parent icon
.proc handle_inactive_window_click
ptr := $6

jsr clear_selection

;; Alternate entry point when volume icon is clicked.
no_clear:
;; Actually make the window active.
MGTK_RELAY_CALL MGTK::SelectWindow, findwindow_window_id
copy findwindow_window_id, active_window_id
jsr LoadActiveWindowEntryTable
jsr draw_window_entries
jsr LoadDesktopEntryTable
jsr activate_window

;; Try to select the window's parent icon. (Only works
;; for volume icons, otherwise it would put selection
;; in an inactive window.)
lda active_window_id
jsr select_icon_for_window
jmp select_icon_for_window
.endproc

;;; Inputs: window id to activate in `findwindow_window_id`
.proc activate_window
;; Make the window active.
MGTK_RELAY_CALL MGTK::SelectWindow, findwindow_window_id
copy findwindow_window_id, active_window_id
jsr LoadActiveWindowEntryTable
jsr draw_window_entries
jsr LoadDesktopEntryTable

;; Update menu items
copy #MGTK::checkitem_uncheck, checkitem_params::check
jsr check_item
jsr get_active_window_view_by
and #kViewByMenuMask
sta checkitem_params::menu_item
inc checkitem_params::menu_item
copy #MGTK::checkitem_check, checkitem_params::check
jsr check_item
rts
jmp check_item
.endproc

;;; ============================================================
Expand Down Expand Up @@ -5686,7 +5688,7 @@ found_win: ; X = window id - 1

;; Otherwise, bring the window to the front.
: stx findwindow_window_id
jmp handle_inactive_window_click::no_clear
jmp activate_window

;; --------------------------------------------------
;; No associated window - check for matching path.
Expand Down

0 comments on commit 9839082

Please sign in to comment.