Commit 6b5593a
Fix seven correctness findings from architecture and code review
1. Position contract. MAUI documents GetPosition(relativeTo) as "the element to use
as the coordinate reference, or null for SCREEN coordinates". The dispatcher was
answering null with the view-local position, which is silently wrong. Gesture
events now carry both spaces (TizenGesturePosition) and resolve null -> screen,
same view -> local, other element -> null. The NUI detectors populate screen
coordinates from TapGesture.ScreenPoint, LongPressGesture.ScreenPoint,
PanGesture.ScreenPosition, PinchGesture.ScreenCenterPoint and
Touch/Hover.GetScreenPosition. A missing screen coordinate stays null rather than
being faked from the local one.
2. Real pixel scaler. AddTizenNuiControlsPlatform now registers a scaler backed by
DeviceInfo.ScalingFactor. Identity scaling is only correct on a 1x display; Tizen
wearables and TVs are not, so every pan, swipe, pinch, tap and pointer coordinate
was wrong by the display factor. The registration is exposed as AddTizenPixelScaler
taking a Func<double>, which is what makes it executable on the host: only reading
the factor needs a device, and that atom is parameterized rather than baked in. The
factor is read lazily because DeviceInfo is unusable until the app has initialised,
and a non-positive or non-finite value degrades to 1 rather than throwing during
window creation.
3. Unsubscribe is detach-only. MAUI calls Unsubscribe on ordinary page churn, not only
at teardown, so dismissing dialogs there cancelled a DisplayAlertAsync the app was
legitimately awaiting across a page swap. Dialogs are now dismissed only in Dispose,
which the container calls at window-scope teardown.
4. Late-bound window. The subscription captured PlatformWindow at construction. MAUI
can create the page handler - and therefore call Subscribe - before the window
handler attaches the native window, so that snapshot could be null forever and
silently drop every alert for the window's lifetime. The window is now resolved per
request, and an unattached window services the request rather than discarding it.
5. Button masks. Tap and pointer dispatch now carry the originating button and filter
against recognizer.Buttons, so a recognizer configured for Primary never fires on a
right-click. Buttons come from Touch.GetMouseButton; Tizen.NUI.Hover exposes no
equivalent, so hovers report none. Touch input reports MouseButton.Invalid, which
maps to Primary - as does anything unclassified, so a stray value can never
fabricate a secondary click.
6. Awaited stack operations. TizenModalHost discarded the PushAsync/PopAsync tasks,
swallowing faults and letting a dialog open over a stack that had not taken the
placeholder. Both are awaited, and ShownBehindPage is unwound even when the push
faults.
7. Cross-window page reuse. A page popped from one window and pushed modally on another
kept a handler bound to the originating window's IMauiContext, realizing it into the
wrong view tree. Such handlers are now disconnected and rebuilt from the target
window's factory, and the target context is applied unconditionally.
Testing
-------
193 tests, up from 158. Each fix was verified load-bearing by reverting it and
confirming the new tests fail: 9 failures across all seven areas, no overlap.
Two API constraints found by the ref-pack lane rather than at runtime:
TapGestureRecognizer.SendTapped takes no button argument, so the mask is enforced by
filtering; and Tizen.NUI.Hover has no GetMouseButton.
Long press remains the one gesture that cannot be dispatched, and the provisional
dotnet/maui#37853 modal contracts and their expiry guard are unchanged.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent 8c18234 commit 6b5593a
22 files changed
Lines changed: 1076 additions & 105 deletions
File tree
- docs
- src/Maui.Tizen.Controls/Core/Platform
- Alerts
- Gestures
- Modal
- Nui
- tests/Controls.UnitTests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
88 | 89 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
95 | 139 | | |
96 | 140 | | |
97 | 141 | | |
| |||
228 | 272 | | |
229 | 273 | | |
230 | 274 | | |
231 | | - | |
| 275 | + | |
| 276 | + | |
232 | 277 | | |
233 | 278 | | |
234 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
113 | 132 | | |
114 | 133 | | |
115 | 134 | | |
| |||
175 | 194 | | |
176 | 195 | | |
177 | 196 | | |
178 | | - | |
| 197 | + | |
| 198 | + | |
179 | 199 | | |
180 | 200 | | |
181 | 201 | | |
| |||
Lines changed: 30 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
84 | 88 | | |
85 | | - | |
| 89 | + | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
96 | 109 | | |
97 | | - | |
98 | | - | |
99 | | - | |
| 110 | + | |
100 | 111 | | |
101 | | - | |
102 | | - | |
103 | 112 | | |
104 | 113 | | |
105 | 114 | | |
| |||
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
129 | | - | |
130 | | - | |
| 138 | + | |
| 139 | + | |
131 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
132 | 147 | | |
133 | 148 | | |
134 | 149 | | |
| |||
137 | 152 | | |
138 | 153 | | |
139 | 154 | | |
140 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
141 | 159 | | |
142 | 160 | | |
143 | 161 | | |
Lines changed: 47 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | | - | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
54 | | - | |
| 61 | + | |
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
60 | 83 | | |
61 | 84 | | |
62 | 85 | | |
63 | | - | |
| 86 | + | |
64 | 87 | | |
65 | 88 | | |
66 | 89 | | |
| |||
202 | 225 | | |
203 | 226 | | |
204 | 227 | | |
205 | | - | |
206 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
207 | 245 | | |
208 | 246 | | |
209 | 247 | | |
| |||
0 commit comments