Commit 223e02a8 authored by Ben Avison's avatar Ben Avison
Browse files

Fixed a number of long-standing but low priority bugs in the Wimp.

Detail:
  * Any top-bit-set sprite area pointer in a window definition was treated
    as a null pointer, and any top-bit-set program name pointer in
    Wimp_ReportError was similarly treated as a null pointer.
  * For 24-bit window colour builds, when the Wimp drew a title bar with
    the input focus, and there were sprite icons in the previously redrawn
    window, and the most recently plotted icon sprite was unpaletted and not
    selected or inverted, then the translation table for the icon sprite (in
    the RMA) would leak. I suppose that's what I get for re-using a bit of
    dead code without fully working out why it was bypassed in the first
    place...
  * The key handling code used to be over-eager to read bytes from the
    keyboard buffer: it would attempt to read up to 6 bytes ahead to ease
    the recognition of UTF-8 character sequences. This could cause problems,
    in particular if F12 was one of those 6 bytes, then any following bytes
    would be queued for use as Wimp keypresses, rather than being left in
    the keyboard buffer for use by ShellCLI. The Wimp now analyses the first
    byte read to make a sensible estimate of how many bytes it needs to read
    ahead.
  * Select-dragging (including Select-resizing) of windows with panes used
    to soak up all the processor time. This was because when the task
    received an Open_Window_Request, it would re-open the pane in front of
    the main window, but this would cause the Wimp to believe that it had to
    re-open the main window at the front of the stack again when Wimp_Poll
    was next called. The problem has been fixed so that the Wimp now
    examines all the windows in front of the drag window to see if they have
    the pane window flag bit set, and doesn't reshuffle the windows if they
    all do. (Actually, the test is performed such that foreground windows
    in front of the drag window are also ignored.)
Admin:
  Tested on a desktop machine.

Version 4.65. Tagged as 'Wimp-4_65'
parent 74e31eed
......@@ -11,14 +11,14 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "4.64"
Module_Version SETA 464
Module_MajorVersion SETS "4.65"
Module_Version SETA 465
Module_MinorVersion SETS ""
Module_Date SETS "16 Mar 2001"
Module_ApplicationDate2 SETS "16-Mar-01"
Module_ApplicationDate4 SETS "16-Mar-2001"
Module_Date SETS "23 Mar 2001"
Module_ApplicationDate2 SETS "23-Mar-01"
Module_ApplicationDate4 SETS "23-Mar-2001"
Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "4.64"
Module_HelpVersion SETS "4.64 (16 Mar 2001)"
Module_FullVersion SETS "4.65"
Module_HelpVersion SETS "4.65 (23 Mar 2001)"
END
/* (4.64)
/* (4.65)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 4.64
#define Module_MajorVersion_CMHG 4.65
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 16 Mar 2001
#define Module_Date_CMHG 23 Mar 2001
#define Module_MajorVersion "4.64"
#define Module_Version 464
#define Module_MajorVersion "4.65"
#define Module_Version 465
#define Module_MinorVersion ""
#define Module_Date "16 Mar 2001"
#define Module_Date "23 Mar 2001"
#define Module_ApplicationDate2 "16-Mar-01"
#define Module_ApplicationDate4 "16-Mar-2001"
#define Module_ApplicationDate2 "23-Mar-01"
#define Module_ApplicationDate4 "23-Mar-2001"
#define Module_ComponentName "Wimp"
#define Module_ComponentPath "RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "4.64"
#define Module_HelpVersion "4.64 (16 Mar 2001)"
#define Module_FullVersion "4.65"
#define Module_HelpVersion "4.65 (23 Mar 2001)"
......@@ -2271,7 +2271,27 @@ trykeys_getinternalkeycode
; Fill our keyboard input buffer from kernel keyboard buffer (needed so we can look ahead)
LDRB R3, keyin_buflen
ADRL R5, keyin_buffer
[ true
MOV R0, #&81 ; OS_Byte 129 (INKEY)
MOV R1, #0
MOV R2, #0 ; time limit 0
SWI XOS_Byte
TEQ R2, #&FF
BEQ %FT02 ; break if no byte available
STRB R1, [R5, R3] ; stick byte in my buffer
ADD R3, R3, #1
TEQ R1, #0 ; null byte (=> either a null or a function key) ?
MOVEQ R7, #2
BEQ %FT01
BL read_current_alphabet
BNE %FT02 ; except in UTF-8, all chars are one byte
MOV R0, R1
BL estimate_UTF8_char_len ; may return length 0, but that's okay because we've already read one byte
MOV R7, R1
01 CMP R3, R7
|
01 CMP R3, #6
]
BGE %FT02 ; break from loop if full
MOV R0, #&81 ; OS_Byte 129 (INKEY)
MOV R1, #0
......@@ -2430,7 +2450,8 @@ prepare_external_key_event
EXIT ; leave flags as they are
get_internal_keycode_from_buffer
; Reads a key from either keyin_buffer or keyprocess_buffer, from a range appropriate to the current alphabet
; Reads a key from one of keyin_buffer, keyprocess_buffer or keystring_buffer,
; from a range appropriate to the current alphabet
; Skips any malformed characters
; Entry: R5 -> buffer
; R7 -> buffer length byte
......@@ -3305,8 +3326,33 @@ wicon_toggle
openwindow_checkbuttons
TST R2,#button_right ; if adjust used, open at same level,
[ true
LDR R14,[handle,#w_bhandle]
BNE %FT02
; first the special cases: if *this* window is a pane or a foreground window, use a bhandle of -1
MOV R4,#wf_isapane
ORR R4,R4,#wf_inborder ; wf_isapane:OR:wf_inborder isn't a valid immediate constant
LDR R3,[handle,#w_flags]
TST R3,R4
MOVNE R14,#nullptr
BNE %FT02
; now check the windows above us in our window stack: if they're all either panes or foreground
; windows, then don't attempt any reordering, otherwise we end up in an endless loop opening
; panes in front of their main windows and vice versa, and nobody else gets any processor time
LDR R1,[handle,#w_active_link+ll_backwards]
01 LDR R2,[R1,#ll_backwards]
CMP R2,#nullptr ; if we've reached the front of the window stack
BEQ %FT02 ; then break leaving R14 = current bhandle
LDR R3,[R1,#w_flags-w_active_link]
TST R3,R4
MOVNE R1,R2
BNE %BT01
MOV R14,#nullptr ; found a non-pane non-foreground window: move drag window to top of stack
02
|
MOVEQ R14,#nullptr ; otherwise open window at front
LDRNE R14,[handle,#w_bhandle]
]
STR R14,[userblk,#u_bhandle]
;
B Exit_OpenWindow
......
......@@ -3179,7 +3179,7 @@ cachespritedata
LDR R14,pixtable_at
TEQ R14,#0 ; does the pixtable exist?
LDRGT R14,pixtable_size
LDRNE R14,pixtable_size
CMP R14,R4 ; is it big enough?
BGE %FT20
......@@ -3268,8 +3268,8 @@ cachespriteaddress ROUT
EXIT EQ
LDR R1,thisCBptr ; R1 -> sprite pool
MOVS R1,R1 ; trap area pointer -1 (none)
MOVMI R1,#area_Wimp
CMP R1,#nullptr ; trap area pointer -1 (none)
MOVEQ R1,#area_Wimp
CMP R1,#area_Wimp ; if its the Wimp or above
BCS %FT10
......
......@@ -2089,8 +2089,9 @@ starterrorbox
MOV R3,#buttontextsize
BL LookupToken
STR R2,[R1,#i_data+i_size*4]
MOVS R4,R6
ADRMI R4,noprogapp
CMP R6,#nullptr
MOVNE R4,R6
ADREQ R4,noprogapp
ADRL R2,watchdogerrtxt
MOV R3,#?watchdogerrtxt
ADR R0,errorptoken
......
......@@ -3092,38 +3092,54 @@ recache_tools_trans
BEQ %FT99
B %FT99
99
CLRV ; clear errors
Pull "PC"
[ TrueIcon3
; In: R2 must be set up as above
; note that the above doesn't fall through any more
; In: R2 -> tool_list
; note that this code seems once to have been part of recache_tools_trans, but was dead
; code until the direct_tools_trans2 label was added as part of the TrueIcon3 work
recache_tools_trans2
Push "R14"
]
Push "R0-R5"
Push "R0-R5,R14"
BIC R2,R2,#1
STR R2,spritename
MOV R2,#0
STR R2,lengthflags
LDR R2,tool_transtable ; try and reuse memory area.
; if pixtable is already in use, we must free it up before we re-use all
; the the standard pixtable variables in order to invoke cachespritedata
LDR R2,pixtable_at
CMP R2,#0
MOVGT R0,#ModHandReason_Free
BLGT XROS_Module
LDR R2,tool_transtable ; reuse tool_transtable memory area
STR R2,pixtable_at
MOV R14,#0
STR R14,tool_transtable ; for safety, make sure that only one variable points to it at once
ADRL R5,tools_trans_size
LDR R2,[R5]
STR R2,pixtable_size
BL cachespritedata ; this sets up pixtable area
BVS %FT98
LDR R0,pixtable_size
STR R0,[R5]
LDR R0,pixtable_at
STR R0,tool_transtable
MOV R0,#0
STR R0,pixtable_at
STR R0,pixtable_at ; exit with standard pixtable marked as needing recalculation
STR R0,pixtable_size
98
Pull "R0-R5"
99
CLRV ; clear errors
Pull "PC"
Pull "R0-R5,PC"
]
LTORG
END
END
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