Closed StefanLobbenmeier closed 5 years ago
This also happen a lot to me. The Steps to reproduce are correct.
This also happens when clicking inside the app (mouse button down), then dragging the cursor out of the app window.
I also get another error:
(embedder._Ctype_struct___1) {
struct_size: (embedder._Ctype_ulong) 80,
phase: (embedder._Ctype_FlutterPointerPhase) 4,
timestamp: (embedder._Ctype_ulong) 1563482087786,
x: (embedder._Ctype_double) 655,
y: (embedder._Ctype_double) 635,
device: (embedder._Ctype_int) 0,
signal_kind: (embedder._Ctype_FlutterPointerSignalKind) 0,
scroll_delta_x: (embedder._Ctype_double) 0,
scroll_delta_y: (embedder._Ctype_double) 0,
device_kind: (embedder._Ctype_FlutterPointerDeviceKind) 1,
buttons: (embedder._Ctype_long) 0
}
flutter: Observatory listening on http://127.0.0.1:50300/D76EqACWb7U=/
go-flutter: no handler found for channel flutter/isolate
(embedder._Ctype_struct___1) {
struct_size: (embedder._Ctype_ulong) 80,
phase: (embedder._Ctype_FlutterPointerPhase) 5,
timestamp: (embedder._Ctype_ulong) 1563482088034,
x: (embedder._Ctype_double) 801,
y: (embedder._Ctype_double) 1021,
device: (embedder._Ctype_int) 0,
signal_kind: (embedder._Ctype_FlutterPointerSignalKind) 0,
scroll_delta_x: (embedder._Ctype_double) 0,
scroll_delta_y: (embedder._Ctype_double) 0,
device_kind: (embedder._Ctype_FlutterPointerDeviceKind) 1,
buttons: (embedder._Ctype_long) 0
}
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: 'package:flutter/src/gestures/converter.dart': Failed assertion: line 359 pos 20: '_pointers.containsKey(datum.device)': is not true.
#0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:40:39)
#1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
#2 PointerEventConverter.expand (package:flutter/src/gestures/converter.dart:359:20)
#3 _SyncIterator.moveNext (dart:core-patch/core_patch.dart:144:12)
#4 ListQueue.addAll (dart:collection/queue.dart:655:25)
#5 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:84:27)
#6 _rootRunUnary (dart:async/zone.dart:1136:13)
#7 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#8 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#9 _invoke1 (dart:ui/hooks.dart:250:10)
#10 _dispatchPointerDataPacket (dart:ui/hooks.dart:159:5)
Syncing files to device Flutter test device... 1 231ms
This happen when I resize the application right after the window is created. I can reproduce the error quite constantly, just have fast very fast!
weirdly enough, adding a glfw.WaitEvent()
before setting CursorPosCallback
solves 'my' issue glfw.WaitEvent()
I have written:
// flutter's PlatformMessage handler is registered through the dart:ui.Window
// interface. ui.Window must have at least paint one frame, before any
// platfrom message can be corectly handled by ui.Window.onPlatformMessage.
it's only based on MY understanding, the comment is certainly false.
The comment is meant to be for Flutter foundation BindingBase window onPointerDataPacket
but I think it also apply to platfrom messages.
@GeertJohan what do you think about a4f132c7a77a, should we keep it? should we remove it and keep the error message (which quite frankly doesn't happen that frequently, I mean WHO is resizing the window in the first 100ms)?
Everyone with a tiling window manager will automatically resize the window right after it has been created. Will WaitEvent always return imediatly? Or could this block the app startup?
edit: misclick closed issue
glfw.WaitEvents()
will not necessary return immediately. But it's fine, because a we need to wait for a engine's paint event.
This will not block the app startup, at some point, paint event will occur. Just to clarify, glfw.WaitEventsTimeout(0.016)
was used because embedder.FlutterEngineFlushPendingTasksNow()
isn't connected to the GLFW event loop.
The end goal with the custom engine event loop interop is to only use glfw.WaitEvents()
.
Is not an urgent issue, as I can see no effect besides that the error is logged. Might indicate other problems though, so thats why I created the issue
Flutter version
Golang errors (Optional)
Compilation works, but runtime error (occurs in pairs as far as I can see, thats why I copied both):
Steps to Reproduce