Skip to content

Commit

Permalink
Dialogs: Don't need to FindWindow when testing for I-beam cursor
Browse files Browse the repository at this point in the history
On mouse move, dialogs with LineEdit controls need to test if the
cursor is over the control and update the cursor shape appropriately.
The File Dialog and DeskTop's Rename (etc) dialog first did a
FindWindow to see if the cursor was over the window - that's not
necessary since the dialog is modal! Just delete the code, everything
is faster and smaller (-27 bytes each).

No functional changes.
  • Loading branch information
inexorabletash committed Oct 10, 2023
1 parent 882e281 commit a3d8102
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
11 changes: 1 addition & 10 deletions desktop/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -13404,16 +13404,7 @@ appleworks:
jsr CheckMouseMoved
bcc PromptInputLoop

MGTK_CALL MGTK::FindWindow, findwindow_params
lda findwindow_params::which_area
beq PromptInputLoop

lda findwindow_params::window_id
cmp #winfo_prompt_dialog::kWindowId
bne PromptInputLoop

;; Is over this window... but where?
copy winfo_prompt_dialog, event_params
copy winfo_prompt_dialog, screentowindow_params::window_id
MGTK_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_CALL MGTK::MoveTo, screentowindow_params::window
MGTK_CALL MGTK::InRect, name_input_rect
Expand Down
11 changes: 0 additions & 11 deletions lib/file_dialog.s
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,6 @@ key_handler_hook:
copy #0, type_down_buf

.ifdef FD_EXTENDED
MGTK_CALL MGTK::FindWindow, findwindow_params
lda findwindow_params::which_area
jeq EventLoop

lda findwindow_params::window_id
cmp #file_dialog_res::kFilePickerDlgWindowID
beq l1
jsr _UnsetCursorIBeam
jmp EventLoop

l1:
jsr _MoveToWindowCoords

bit extra_controls_flag
Expand Down

0 comments on commit a3d8102

Please sign in to comment.