Commit 0148e0ea authored by Andy Vawer's avatar Andy Vawer Committed by ROOL
Browse files

Abandon set caret position if the window or menu isn't there

During destruction of the menu tree, if set caret position fails when resetting the caret to the old position (ie. illegal window handle as the window has been deleted) then destroying the menu tree also fails with catastrophic results.
* Do not fault SetCaretPosition to invalid window handle, just change it to -1
* Do not try to redraw areas of an invalid window when moving caret

Version 5.82. Not tagged
parent e62f3580
......@@ -12,9 +12,9 @@
Module_MajorVersion SETS "5.82"
Module_Version SETA 582
Module_MinorVersion SETS ""
Module_Date SETS "14 Jul 2021"
Module_ApplicationDate SETS "14-Jul-21"
Module_Date SETS "13 Sep 2021"
Module_ApplicationDate SETS "13-Sep-21"
Module_ComponentName SETS "Wimp"
Module_FullVersion SETS "5.82"
Module_HelpVersion SETS "5.82 (14 Jul 2021)"
Module_HelpVersion SETS "5.82 (13 Sep 2021)"
......@@ -5,17 +5,17 @@
#define Module_MajorVersion_CMHG 5.82
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Jul 2021
#define Module_Date_CMHG 13 Sep 2021
#define Module_MajorVersion "5.82"
#define Module_Version 582
#define Module_MinorVersion ""
#define Module_Date "14 Jul 2021"
#define Module_Date "13 Sep 2021"
#define Module_ApplicationDate "14-Jul-21"
#define Module_ApplicationDate "13-Sep-21"
#define Module_ComponentName "Wimp"
#define Module_FullVersion "5.82"
#define Module_HelpVersion "5.82 (14 Jul 2021)"
#define Module_HelpVersion "5.82 (13 Sep 2021)"
#define Module_LibraryVersionInfo "5:82"
......@@ -112,7 +112,8 @@ int_set_caret_position ROUT
MOVEQ R2,#0 ; if we were called with R2='TASK' then
STREQ R2,[sp,#(2+1+8)*4] ; ensure R2=0 on return - taskhandle stacked below r2
SavePSR R6 ; keep V flag for exiting later
CLRV ; clear V flag as we're not going to report this as an error
SavePSR R6
Push "R6"
STR R0,[sp,#8] ; preserve error message
MOV R0,#-1 ; carry on as an invalid window handle
......@@ -541,6 +542,12 @@ wscp_remove_current_caret ROUT
; r4=flags
Push "R0-R5,R10,R11,R14"
; ensure we're removing from a valid window
Push "handle"
MOV handle,R0
BL checkhandle
Pull "handle"
MOVVS R0,#nullptr ; handle was invalid so change it to 'no window'
; clear redraw block
MOV R14,#nullptr
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment