Skip to content

An exception is logged when maximizing the window vertically #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
StefanLobbenmeier opened this issue Jul 17, 2019 · 6 comments
Closed
Labels
embedder Issue concerns the embedder package warning

Comments

@StefanLobbenmeier
Copy link
Contributor

StefanLobbenmeier commented Jul 17, 2019

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

Flutter 1.7.8+hotfix.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b712a172f9 (8 days ago) • 2019-07-09 13:14:38 -0700
Engine • revision 54ad777fd2
Tools • Dart 2.4.0

Golang errors (Optional)

Compilation works, but runtime error (occurs in pairs as far as I can see, thats why I copied both):

[ERROR:c:\b\s\w\ir\k\src\flutter\lib\ui\ui_dart_state.cc(148)] Unhandled Exception: 'package:flutter/src/gestures/converter.da
rt': Failed assertion: line 251 pos 20: 'state.down': 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:251:20)
#3      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:152: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)

[ERROR:c:\b\s\w\ir\k\src\flutter\lib\ui\ui_dart_state.cc(148)] Unhandled Exception: 'package:flutter/src/gestures/converter.da
rt': Failed assertion: line 251 pos 20: 'state.down': 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:251:20)
#3      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:152: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)

Steps to Reproduce

  1. My code looks like this
return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: FutureWrapper<List<Entry>>(
        classifications,
        (context, _entry) => ListView(
              children: _entry
                  .map((entry) => ListEntry(entry))
                  .toList(),
            ),
        key: Key("List of Entries"),
      ),
    );
  1. I run it with hover run on Windows
  2. When doubleclick on the bottom edge (to maximize in the vertical direction), this exception occurs
@pchampio
Copy link
Member

This also happen a lot to me.
The Steps to reproduce are correct.

@pchampio pchampio added embedder Issue concerns the embedder package warning labels Jul 17, 2019
@GeertJohan
Copy link
Member

This also happens when clicking inside the app (mouse button down), then dragging the cursor out of the app window.

@GeertJohan GeertJohan changed the title [Minor] An exception is logged when maximizing the window vertically An exception is logged when maximizing the window vertically Jul 18, 2019
pchampio added a commit that referenced this issue Jul 18, 2019
@pchampio
Copy link
Member

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()

@pchampio
Copy link
Member

pchampio commented Jul 18, 2019

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 a4f132c, 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)?

@GeertJohan
Copy link
Member

GeertJohan commented Jul 19, 2019

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

@pchampio
Copy link
Member

pchampio commented Jul 19, 2019

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().

pchampio added a commit that referenced this issue Jul 22, 2019
* fixes #198

* fixe weird edge case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedder Issue concerns the embedder package warning
Development

No branches or pull requests

3 participants