File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -131,15 +131,19 @@ func (m *windowManager) handleButtonPhase(window *glfw.Window, action glfw.Actio
131
131
}
132
132
133
133
if action == glfw .Release {
134
+ // Always send a pointer event with PhaseMove before an eventual
135
+ // PhaseUp. Even if the last button was released. If x/y on the last
136
+ // move doesn't equal x/y on the PhaseUp, the click is canceled in
137
+ // Flutter. On MacOS, the Release event always has y-1 of the last move
138
+ // event. By sending a PhaseMove here (after the release) we avoid a
139
+ // difference in x/y.
140
+ m .sendPointerEventButton (window , embedder .PointerPhaseMove )
141
+
134
142
m .pointerButton ^= buttons
135
143
// If all button are released then m.pointerButton is cleared
136
144
if m .pointerButton == 0 {
137
145
m .sendPointerEventButton (window , embedder .PointerPhaseUp )
138
146
m .pointerPhase = embedder .PointerPhaseHover
139
- } else {
140
- // if any other buttons are still pressed when one button is released
141
- // the engine is expecting a Move phase instead of a Up phase.
142
- m .sendPointerEventButton (window , embedder .PointerPhaseMove )
143
147
}
144
148
}
145
149
}
You can’t perform that action at this time.
0 commit comments