Project

General

Profile

test-11180-g-teardown-apply.p

Sergey Ivanovskiy, 08/17/2026 05:51 AM

Download (5.21 KB)

 
1
/*------------------------------------------------------------------------------
2
  test-11180-g-teardown-apply.p                                    (APPLY path)
3

    
4
  DRAFT probe for #11180 review findings 1 & 2 (window-teardown misread as a
5
  "steal").  PURPOSE: establish the native-OpenEdge baseline for the case the
6
  existing suite does NOT cover - a bare requestFocus focus fallback (window
7
  teardown) rather than a nested APPLY 'ENTRY' steal.  The correct FWD behaviour
8
  cannot be decided by reasoning; it must be read off a native-OE run of this
9
  probe (per the project rule).  Adjust the topology if it does not reach the
10
  ThinClient.processProgressEvent "stolen" branch on FWD.
11

    
12
  Background.  The #11180 fix classifies a "steal" as: old focus's frame deleted
13
  mid-LEAVE AND current focus moved off the old focus.  The pre-fix .~2~ revision
14
  additionally required  redirected == pendingFocus  - i.e. the redirect came
15
  from a nested APPLY 'ENTRY' (which records its target in pendingFocus), NOT a
16
  bare requestFocus.  That clause was dropped.  A window teardown moves focus via
17
  GuiWindowCommons.hide -> WindowManager.setFocusWindow -> requestFocus (a bare
18
  refocus that sets no pendingFocus), so FWD 11180b now misclassifies it as a
19
  steal and DROPS the outer APPLY 'ENTRY'.
20

    
21
  Topology (window teardown, NO nested APPLY):
22
    - secondary WINDOW W2 holds fill-in fO; focus is parked in fO.
23
    - the default window holds fill-in fT (the outer APPLY target) in frame frmT.
24
    - sequence: APPLY 'ENTRY' TO fO (park in W2), then APPLY 'ENTRY' TO fT.
25
    - fO's frame LEAVE DELETEs window W2 and does NO APPLY.  Deleting the window
26
      makes FWD reassign focus via a bare requestFocus to a surviving-window
27
      widget (NOT via APPLY 'ENTRY').
28

    
29
  OPEN QUESTION (unmeasured by any existing probe): does OpenEdge treat the
30
  bare-refocus fallback as a steal (keep the fallback focus, DROP the outer
31
  APPLY 'ENTRY' TO fT) or let the outer APPLY target win (enter fT)?
32

    
33
  Expected (native OpenEdge): <to be recorded from the OE run>
34
  FWD 11180b (post-review):   fT ENTRY dropped; focus kept on the teardown
35
                              fallback widget (candidate bug per findings 1/2).
36

    
37
  FWD drives the APPLY path synchronously, so this runs head-less: log to
38
  test-11180-g-apply.log, then QUIT.
39
------------------------------------------------------------------------------*/
40

    
41
DEFINE VARIABLE fO  AS CHARACTER NO-UNDO FORMAT "x(8)" INITIAL "ooo".
42
DEFINE VARIABLE fT  AS CHARACTER NO-UNDO FORMAT "x(8)" INITIAL "ttt".
43
DEFINE VARIABLE seq AS INTEGER   NO-UNDO.
44

    
45
DEFINE VARIABLE hWin2 AS HANDLE NO-UNDO.
46
DEFINE VARIABLE hFrmO AS HANDLE NO-UNDO.
47
DEFINE VARIABLE hFO   AS HANDLE NO-UNDO.
48

    
49
DEFINE FRAME frmT fT WITH TITLE "FRAME-T (APPLY target, default window)"
50
   AT ROW 3 COLUMN 2 SIZE 44 BY 3.
51

    
52
PROCEDURE logit:
53
   DEFINE INPUT PARAMETER m AS CHARACTER NO-UNDO.
54
   seq = seq + 1.
55
   OUTPUT TO "test-11180-g-apply.log" APPEND.
56
   PUT UNFORMATTED STRING(seq, "99") " " m SKIP.
57
   OUTPUT CLOSE.
58
END PROCEDURE.
59

    
60
/* fO's frame LEAVE: tear down the WHOLE secondary window (bare-refocus fallback),
61
   with NO APPLY 'ENTRY' - this is the window-teardown case, not a nested steal. */
62
PROCEDURE oLeave:
63
   RUN logit("frmO  LEAVE  (begin - delete secondary WINDOW W2, NO APPLY)").
64
   IF VALID-HANDLE(hWin2) THEN DELETE WIDGET hWin2.
65
   RUN logit("frmO  LEAVE  (end - no APPLY performed)").
66
END PROCEDURE.
67

    
68
/* target frame T triggers (default window) */
69
ON ENTRY OF FRAME frmT
70
   RUN logit("frmT  ENTRY  <== target FRAME ENTRY").
71
ON ENTRY OF fT IN FRAME frmT
72
   RUN logit("fT    ENTRY  <== outer APPLY target ENTRY (dropped by candidate bug?)").
73
ON LEAVE OF fT IN FRAME frmT
74
   RUN logit("fT    LEAVE").
75

    
76
/* ---- main ---- */
77
OUTPUT TO "test-11180-g-apply.log".
78
PUT UNFORMATTED "=== test-11180-g-teardown-apply start ===" SKIP.
79
OUTPUT CLOSE.
80

    
81
ENABLE fT WITH FRAME frmT.
82
VIEW FRAME frmT.
83

    
84
/* secondary WINDOW W2 with its own frame + fill-in fO */
85
CREATE WINDOW hWin2
86
   ASSIGN TITLE = "WINDOW-2 (torn down in its own LEAVE)"
87
          WIDTH = 40 HEIGHT = 6 VISIBLE = FALSE.
88
CREATE FRAME hFrmO
89
   ASSIGN TITLE = "FRAME-O (source, in window 2)"
90
          PARENT = hWin2
91
          ROW = 2 COLUMN = 2 WIDTH = 34 HEIGHT = 3
92
          BOX = TRUE VISIBLE = FALSE.
93
CREATE FILL-IN hFO
94
   ASSIGN FRAME = hFrmO
95
          NAME = "fO" FORMAT = "x(8)" SCREEN-VALUE = "ooo"
96
          X = 4 Y = 4 WIDTH = 20
97
          SENSITIVE = TRUE VISIBLE = TRUE.
98
hFrmO:VISIBLE = TRUE.
99
hWin2:VISIBLE  = TRUE.
100

    
101
/* LEAVE on the source frame tears down window W2 (no APPLY) */
102
ON "LEAVE":U OF hFrmO PERSISTENT RUN oLeave.
103

    
104
RUN logit("--- APPLY ENTRY to fO (park focus in secondary window W2) ---").
105
APPLY "ENTRY" TO hFO.
106

    
107
IF VALID-HANDLE(FOCUS) THEN
108
   RUN logit("--- FOCUS before move: TYPE=" + STRING(FOCUS:TYPE) + " ---").
109
ELSE
110
   RUN logit("--- FOCUS before move: <none> ---").
111

    
112
RUN logit("--- APPLY ENTRY to fT (outer target; fO's LEAVE deletes window W2) ---").
113
APPLY "ENTRY" TO fT IN FRAME frmT.
114
PROCESS EVENTS.
115
RUN logit("--- done; FOCUS is now: "
116
          + (IF VALID-HANDLE(FOCUS) THEN STRING(FOCUS:TYPE) + "/" + FOCUS:NAME
117
             ELSE "<none/invalid>") + " ---").
118
RUN logit("--- OPEN QUESTION: OE = does fT win (ENTRY fires) or is it a steal? ---").
119
RUN logit("--- FWD 11180b:    fT ENTRY expected DROPPED (candidate findings 1/2) ---").
120
QUIT.