Commit 791a168f authored by Andy Vawer's avatar Andy Vawer Committed by ROOL
Browse files

Allow text to be dragged from writable icons to icon bar icons

Check destination window handle and add destination icon handle if sending message to window handle -2.
Improve window handle validation (not assuming all -ve handles are invalid, should the RMA move to have top bit set).

Version 5.72. Tagged as 'Wimp-5_72'
parent 1475387a
......@@ -9,12 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
Module_MajorVersion SETS "5.71"
Module_Version SETA 571
Module_MajorVersion SETS "5.72"
Module_Version SETA 572
Module_MinorVersion SETS ""
Module_Date SETS "30 Jan 2020"
Module_ApplicationDate SETS "30-Jan-20"
Module_Date SETS "11 Apr 2020"
Module_ApplicationDate SETS "11-Apr-20"
Module_ComponentName SETS "Wimp"
Module_FullVersion SETS "5.71"
Module_HelpVersion SETS "5.71 (30 Jan 2020)"
Module_FullVersion SETS "5.72"
Module_HelpVersion SETS "5.72 (11 Apr 2020)"
END
/* (5.71)
/* (5.72)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 5.71
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 30 Jan 2020
#define Module_MajorVersion_CMHG 5.72
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 11 Apr 2020
#define Module_MajorVersion "5.71"
#define Module_Version 571
#define Module_MajorVersion "5.72"
#define Module_Version 572
#define Module_MinorVersion ""
#define Module_Date "30 Jan 2020"
#define Module_Date "11 Apr 2020"
#define Module_ApplicationDate "30-Jan-20"
#define Module_ApplicationDate "11-Apr-20"
#define Module_ComponentName "Wimp"
#define Module_FullVersion "5.71"
#define Module_HelpVersion "5.71 (30 Jan 2020)"
#define Module_LibraryVersionInfo "5:71"
#define Module_FullVersion "5.72"
#define Module_HelpVersion "5.72 (11 Apr 2020)"
#define Module_LibraryVersionInfo "5:72"
......@@ -331,10 +331,17 @@ cbtask_run_datasave
BIC R3,R3,#3
STR R3,[R9,#ms_size] ; message size
LDR R2,[R9,#ms_taskhandle]
CMP R2,#-2 ; message going to the iconbar, so we need the iconbar icon handle
BNE %FT03
SUB R1,R13,#20
SWI XWimp_GetPointerInfo
BVS cbtask_export_finished
LDR R3,[R13,#-4] ; (R13-20) + 16 - get icon handle
03
MOV R0,#User_Message_Recorded
MOV R1,R9
LDR R2,[R1,#ms_taskhandle]
SWI XWimp_SendMessage
BVS cbtask_export_finished
......@@ -1624,14 +1631,20 @@ cbtask_idle
LDRNE R14,[R11,#cbtask_var_lastref]
BNE %FT10
LDR R2,[R11,#cbtask_pollblock+64+12] ; window handle
CMP R2,#0
BLT cbtask_poll ; no valid window handle
CMP R2,#-2
BEQ %FT09 ; is iconbar, so don't look for writable icon
MOV R10,R2
BL checkhandle ; is it a valid handle?
BVC %FT08 ; is fine so continue with icon checks
CLRV ; invalid window handle, so clear error
B cbtask_poll ; and abandon
08
; are we about to send to a writable icon? If so, we can do things internally instead
LDR R3,[R11,#cbtask_pollblock+64+16] ; icon handle
CMP R3,#0
BLT %FT09 ; not a valid icon, so continue
Abs R10,R2
; Abs R10,R2 ; already set up by checkhandle
LDR R14,[R10,#w_nicons]
CMP R3,R14
BGE %FT09 ; not a valid icon, so continue
......@@ -1646,7 +1659,6 @@ cbtask_idle
; we are sending to a writeable icon, so bypass the sending stuff
ADRL R14,clipboard_taskhandle
LDR R2,[R14] ; redirect to us
09
MOV R0,#User_Message
LDRB R14,[R11,#cbtask_var_drag_finished] ; make it User_Message_Recorded if drag finished
......@@ -1719,12 +1731,20 @@ cbtask_message_dragging_bounced_int
LDRB R14,[R11,#cbtask_var_drag_finished]
ADD R0,R0,R14 ; make it User_Message_Recorded if drag finished
; redirect internally if we're going to a writable icon?
CMP R2,#0
BLT cbtask_poll ; no window
LDR R3,[R11,#cbtask_pollblock+64+16] ; icon handle
CMP R2,#-2
BEQ %FT09 ; it's an iconbar icon, so skip the internal send check
; R3 also now set up for sending to the icon
MOV R10,R2
BL checkhandle ; is it a valid window handle?
BVC %FT08 ; yes, so check if it's an internal message
CLRV ; no, so clear error
B cbtask_poll ; and bail out
08
CMP R3,#0
BLT %FT09 ; not a valid icon, so continue
Abs R10,R2
; Abs R10,R2 ; already set up by checkhandle above
LDR R14,[R10,#w_nicons]
CMP R3,R14
BGE %FT09 ; not a valid icon, so continue
......@@ -1906,7 +1926,7 @@ cbtask_get_selected_text
; get pointer to icon data
LDR R10,selectionwindow ; selection window handle
CMP R10,#-1 ; for some reason, it's no longer valid
SETV EQ
SETV EQ
Pull "PC",VS ; bail out with error
Abs R10,R10
......
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