1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-07 19:10:25 +00:00

Properly clears the mouse queue after dialogs are closed.

This commit is contained in:
FellippeHeitor 2021-07-22 03:05:00 -03:00
parent 231400f309
commit d3807589ca

View file

@ -6658,6 +6658,7 @@ SUB DebugMode
r$ = idesubs r$ = idesubs
PCOPY 3, 0: SCREEN , , 3, 0 PCOPY 3, 0: SCREEN , , 3, 0
GOSUB UpdateDisplay GOSUB UpdateDisplay
WHILE _MOUSEINPUT: WEND
CASE 15872 'F4 CASE 15872 'F4
IF PauseMode THEN IF PauseMode THEN
requestCallStack: requestCallStack:
@ -6670,9 +6671,13 @@ SUB DebugMode
setStatusMessage 1, "Requesting call stack...", 7 setStatusMessage 1, "Requesting call stack...", 7
start! = TIMER start! = TIMER
callStackLength = -1
DO DO
GOSUB GetCommand GOSUB GetCommand
IF cmd$ = "call stack size" THEN callStackLength = CVL(value$) IF cmd$ = "call stack size" THEN
callStackLength = CVL(value$)
IF callStackLength = 0 THEN EXIT DO
END IF
_LIMIT 100 _LIMIT 100
LOOP UNTIL cmd$ = "call stack" OR TIMER - start! > timeout LOOP UNTIL cmd$ = "call stack" OR TIMER - start! > timeout
@ -6680,13 +6685,20 @@ SUB DebugMode
'display call stack 'display call stack
callstacklist$ = value$ callstacklist$ = value$
ShowCallStack: ShowCallStack:
retval = idecallstackbox
PCOPY 3, 0: SCREEN , , 3, 0
clearStatusWindow 0 clearStatusWindow 0
setStatusMessage 1, "Paused.", 2 setStatusMessage 1, "Paused.", 2
retval = idecallstackbox
PCOPY 3, 0: SCREEN , , 3, 0
WHILE _MOUSEINPUT: WEND
ELSE ELSE
clearStatusWindow 0 IF callStackLength = -1 THEN
setStatusMessage 1, "Error retrieving call stack.", 2 callStackLength = 0
clearStatusWindow 0
setStatusMessage 1, "Error retrieving call stack.", 2
ELSEIF callStackLength = 0 THEN
clearStatusWindow 0
setStatusMessage 1, "No call stack log available.", 2
END IF
END IF END IF
noFocusMessage = NOT noFocusMessage noFocusMessage = NOT noFocusMessage
END IF END IF
@ -6759,8 +6771,9 @@ SUB DebugMode
IF _KEYDOWN(100304) OR _KEYDOWN(100303) THEN IF _KEYDOWN(100304) OR _KEYDOWN(100303) THEN
result = idegetlinenumberbox("Run To Line", idecy) result = idegetlinenumberbox("Run To Line", idecy)
PCOPY 3, 0: SCREEN , , 3, 0 PCOPY 3, 0: SCREEN , , 3, 0
WHILE _MOUSEINPUT: WEND
requestRunToThisLine: requestRunToThisLine:
IF result > 0 AND result < iden THEN IF result > 0 AND result <= iden THEN
PauseMode = 0 PauseMode = 0
debugnextline = 0 debugnextline = 0
cmd$ = "run to line:" + MKL$(result) cmd$ = "run to line:" + MKL$(result)
@ -6773,8 +6786,9 @@ SUB DebugMode
ELSE ELSE
result = idegetlinenumberbox("Set Next Line", idecy) result = idegetlinenumberbox("Set Next Line", idecy)
PCOPY 3, 0: SCREEN , , 3, 0 PCOPY 3, 0: SCREEN , , 3, 0
WHILE _MOUSEINPUT: WEND
requestSetNextLine: requestSetNextLine:
IF result > 0 AND result < iden THEN IF result > 0 AND result <= iden THEN
cmd$ = "set next line:" + MKL$(result) cmd$ = "set next line:" + MKL$(result)
GOSUB SendCommand GOSUB SendCommand
END IF END IF
@ -6784,6 +6798,7 @@ SUB DebugMode
IF _KEYDOWN(100306) OR _KEYDOWN(100305) THEN IF _KEYDOWN(100306) OR _KEYDOWN(100305) THEN
result = idegetlinenumberbox("Skip Line", idecy) result = idegetlinenumberbox("Skip Line", idecy)
PCOPY 3, 0: SCREEN , , 3, 0 PCOPY 3, 0: SCREEN , , 3, 0
WHILE _MOUSEINPUT: WEND
requestToggleSkipLine: requestToggleSkipLine:
IF result > 0 AND result <= iden THEN IF result > 0 AND result <= iden THEN
IdeSkipLines(result) = NOT IdeSkipLines(result) IdeSkipLines(result) = NOT IdeSkipLines(result)
@ -6840,15 +6855,19 @@ SUB DebugMode
'requested when the program is about to quit or 'requested when the program is about to quit or
'when an error just occurred 'when an error just occurred
callStackLength = CVL(value$) callStackLength = CVL(value$)
start! = TIMER IF callStackLength THEN
DO start! = TIMER
GOSUB GetCommand DO
_LIMIT 100 GOSUB GetCommand
LOOP UNTIL cmd$ = "call stack" OR TIMER - start! > timeout _LIMIT 100
LOOP UNTIL cmd$ = "call stack" OR TIMER - start! > timeout
IF cmd$ = "call stack" THEN IF cmd$ = "call stack" THEN
'store call stack 'store call stack
callstacklist$ = value$ callstacklist$ = value$
END IF
ELSE
callstacklist$ = ""
END IF END IF
END SELECT END SELECT