Skip to content

Flutter Desktop application turns transparent on switching workspaces in tiling wm #68391

@daaniiieel

Description

@daaniiieel

Steps to Reproduce

  1. Run flutter create flutterfreeze.
  2. Update main.dart as follows (not needed, but used in the gif):
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(child: Text('test')),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.add),
      ),);
  }
}
  1. Execute flutter run. Wait for the window to open, then switch workspaces in a tiling window manager. When you switch back, the flutter part of the application turns transparent, until resizing a window

Expected results: The application works fine even after switching workspaces

Actual results: The application turns transparent and becomes unusable, until manually resizing the window. Tested with dwm (on the gif), and bspwm.
flutter

Logs
[ +145 ms] executing: [/opt/flutter/] git -c log.showSignature=false log -n 1
--pretty=format:%H
[  +45 ms] Exit code 0 from: git -c log.showSignature=false log -n 1
--pretty=format:%H
[        ] 37ebe3d82a9d5faeda7d3c1a6ad193030210a2cc
[   +1 ms] executing: [/opt/flutter/] git tag --points-at HEAD
[  +16 ms] Exit code 0 from: git tag --points-at HEAD
[        ] 1.23.0-18.0.pre
[  +13 ms] executing: [/opt/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[   +5 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/dev
[        ] executing: [/opt/flutter/] git ls-remote --get-url origin
[   +7 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +63 ms] executing: [/opt/flutter/] git rev-parse --abbrev-ref HEAD
[   +7 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] dev
[  +57 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required,
skipping update.
[   +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping
update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required,
skipping update.
[  +75 ms] executing: /opt/android-sdk/platform-tools/adb devices -l
[  +59 ms] List of devices attached
[   +8 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping
update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping
update.
[   +2 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required,
skipping update.
[ +262 ms] Generating
/home/daniel/flutterfreeze/android/app/src/main/java/io/flutter/plugins/Generate
dPluginRegistrant.java
[  +70 ms] Starting incremental build...
[   +3 ms] Initializing file store
[  +13 ms] Skipping target: gen_localizations
[  +10 ms] complete
[   +5 ms] Launching lib/main.dart on Linux in debug mode...
[   +9 ms] /opt/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev
/opt/flutter/bin/cache/artifacts/engine/linux-x64/frontend_server.dart.snapshot
--sdk-root /opt/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/
--incremental --target=flutter --debugger-module-names
--experimental-emit-debug-metadata -Ddart.developer.causal_async_stacks=true
--output-dill /tmp/flutter_tools.AMPQMC/flutter_tool.BLVYWL/app.dill --packages
.packages -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts
--track-widget-creation --filesystem-scheme org-dartlang-root
--initialize-from-dill
build/01094840f26094a3fe371d8be6b9cb48.cache.dill.track.dill
--flutter-widget-cache
[  +21 ms] Building Linux application...
[  +15 ms] <- compile package:flutterfreeze/main.dart
[   +4 ms] executing: [build/linux/debug/] cmake -G Ninja
-DCMAKE_BUILD_TYPE=Debug /home/daniel/flutterfreeze/linux
[  +46 ms] -- Configuring done
[  +11 ms] -- Generating done
[  +25 ms] -- Build files have been written to:
/home/daniel/flutterfreeze/build/linux/debug
[  +10 ms] executing: ninja -C build/linux/debug install
[  +11 ms] ninja: Entering directory `build/linux/debug'
[+7971 ms] [1/5] Generating /home/daniel/flutterfreeze/linux/flutter/ephemeral/libflutter_linux_gtk.so,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_basic_message_channel.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_binary_codec.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_binary_messenger.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_dart_project.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_engine.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_json_message_codec.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_json_method_codec.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_message_codec.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_method_call.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_method_channel.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_method_codec.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_method_response.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_plugin_registrar.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_plugin_registry.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_standard_message_codec.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_standard_method_codec.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_string_codec.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_value.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/fl_view.h,
/home/daniel/flutterfreeze/linux/flutter/ephemeral/flutter_linux/flutter_linux.h, _phony_
[   +9 ms] [ +152 ms] executing: [/opt/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] [  +49 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] [        ] 37ebe3d82a9d5faeda7d3c1a6ad193030210a2cc
[        ] [        ] executing: [/opt/flutter/] git tag --points-at HEAD
[        ] [  +14 ms] Exit code 0 from: git tag --points-at HEAD
[        ] [        ] 1.23.0-18.0.pre
[        ] [  +12 ms] executing: [/opt/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[        ] [  +17 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] [        ] origin/dev
[        ] [        ] executing: [/opt/flutter/] git ls-remote --get-url origin
[        ] [   +5 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] [        ] https://github.com/flutter/flutter.git
[        ] [  +78 ms] executing: [/opt/flutter/] git rev-parse --abbrev-ref HEAD
[        ] [   +7 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] [        ] dev
[        ] [ +104 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] [   +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] [   +2 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] [   +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] [ +109 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] [   +2 ms] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] [        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] [   +1 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [   +2 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[        ] [ +137 ms] Initializing file store
[        ] [  +12 ms] Done initializing file store
[        ] [  +48 ms] Skipping target: gen_localizations
[        ] [+2644 ms] Skipping target: kernel_snapshot
[        ] [+3138 ms] Skipping target: unpack_linux
[        ] [ +612 ms] Skipping target: debug_bundle_linux_assets
[        ] [   +1 ms] Persisting file store
[        ] [  +12 ms] Done persisting file store
[        ] [   +6 ms] build succeeded.
[        ] [  +13 ms] "flutter assemble" took 6,783ms.
[        ] [   +9 ms] Running shutdown hooks
[        ] [        ] Shutdown hooks complete
[        ] [   +4 ms] exiting with code 0
[+2007 ms] [2/5] Building CXX object CMakeFiles/flutterfreeze.dir/flutter/generated_plugin_registrant.cc.o
[   +1 ms] [3/5] Building CXX object CMakeFiles/flutterfreeze.dir/my_application.cc.o
[ +415 ms] [4/5] Linking CXX executable intermediates_do_not_run/flutterfreeze
[        ] [4/5] Install the project...
[ +153 ms] -- Install configuration: "Debug"
[  +44 ms] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/flutterfreeze
[   +3 ms] -- Set runtime path of "/home/daniel/flutterfreeze/build/linux/debug/bundle/flutterfreeze" to "$ORIGIN/lib"
[        ] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/data/icudtl.dat
[   +4 ms] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/lib/libflutter_linux_gtk.so
[ +491 ms] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/data/flutter_assets
[   +2 ms] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/data/flutter_assets/AssetManifest.json
[        ] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/data/flutter_assets/NOTICES
[   +2 ms] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/data/flutter_assets/kernel_blob.bin
[ +129 ms] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/data/flutter_assets/fonts
[        ] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/data/flutter_assets/fonts/MaterialIcons-Regular.otf
[   +4 ms] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/data/flutter_assets/FontManifest.json
[        ] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/data/flutter_assets/packages
[        ] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/data/flutter_assets/packages/cupertino_icons
[        ] -- Installing: /home/daniel/flutterfreeze/build/linux/debug/bundle/data/flutter_assets/packages/cupertino_icons/assets
[        ] -- Installing:
/home/daniel/flutterfreeze/build/linux/debug/bundle/data/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf
[  +17 ms] Building Linux application... (completed in 11.4s)
[ +501 ms] Observatory URL on device:
http://127.0.0.1:32985/HiZv2MHzmh0=/
[+2218 ms] flutter: ══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY
╞══════════════════════════════════════════════════════════
[   +4 ms] flutter: The following assertion was thrown during a
platform message callback:
[        ] flutter: Attempted to send a key down event when no
keys are in keysPressed. This state can occur if the key
[        ] flutter: event being sent doesn't properly set its
modifier flags. This was the event:
[        ] flutter: RawKeyDownEvent#e9dd0(logicalKey:
LogicalKeyboardKey#00011(keyId: "0x100000011", keyLabel: "",
[        ] flutter: debugName: "Super Key"), physicalKey:
PhysicalKeyboardKey#700e3(usbHidUsage: "0x000700e3",
[   +1 ms] flutter: debugName: "Meta Left")) and its data:
RawKeyEventDataLinux(keyLabel: , keyCode: 65515, scanCode:
[        ] flutter: 133, unicodeScalarValues: 0, modifiers: 0,
modifiers down: {})
[        ] flutter:
'package:flutter/src/services/raw_keyboard.dart':
[        ] flutter: Failed assertion: line 617 pos 12: '<optimized
out>'
[        ] flutter:
[        ] flutter: Either the assertion indicates an error in the
framework itself, or we should provide substantially
[        ] flutter: more information in this error message to help
you determine and fix the underlying cause.
[        ] flutter: In either case, please report this assertion
by filing a bug on GitHub:
[        ] flutter:
https://github.com/flutter/flutter/issues/new?template=BUG.md
[        ] flutter:
[        ] flutter: When the exception was thrown, this was the
stack:
[        ] flutter: #2      RawKeyboard._handleKeyEvent
(package:flutter/src/services/raw_keyboard.dart:617:12)
[        ] flutter: #3
BasicMessageChannel.setMessageHandler.<anonymous closure>
(package:flutter/src/services/platform_channel.dart:74:49)
[        ] flutter: #4
_DefaultBinaryMessenger.handlePlatformMessage
(package:flutter/src/services/binding.dart:283:33)
[        ] flutter: #5      _invoke3.<anonymous closure>
(dart:ui/hooks.dart:280:15)
[        ] flutter: #9      _invoke3 (dart:ui/hooks.dart:279:10)
[        ] flutter: #10     _dispatchPlatformMessage
(dart:ui/hooks.dart:154:5)
[        ] flutter: (elided 5 frames from class _AssertionError
and dart:async)
[        ] flutter:
══════════════════════════════════════════════════════════════════
══════════════════════════════════
[ +803 ms] Caching compiled dill
[  +86 ms] Connecting to service protocol:
http://127.0.0.1:32985/HiZv2MHzmh0=/
[   +3 ms] Launching a Dart Developer Service (DDS) instance at
http://127.0.0.1:0, connecting to VM service at
http://127.0.0.1:32985/HiZv2MHzmh0=/.
[ +229 ms] DDS is listening at
http://127.0.0.1:39437/nmZoky0ydP8=/.
[  +90 ms] Successfully connected to service protocol:
http://127.0.0.1:32985/HiZv2MHzmh0=/
[        ] Waiting for Linux to report its views...
[   +7 ms] Waiting for Linux to report its views... (completed in
6ms)
[  +10 ms] DevFS: Creating new filesystem on the device (null)
[  +17 ms] DevFS: Created new filesystem on the device
(file:///tmp/flutterfreezeAJHJUQ/flutterfreeze/)
[   +2 ms] Updating assets
[  +97 ms] Syncing files to device Linux...
[   +3 ms] <- reset
[        ] Compiling dart to kernel with 0 updated files
[   +2 ms] <- recompile package:flutterfreeze/main.dart
137006d9-5211-482b-a5aa-c033a238e129
[        ] <- 137006d9-5211-482b-a5aa-c033a238e129
[ +107 ms] Updating files.
[        ] DevFS: Sync finished
[        ] Syncing files to device Linux... (completed in 115ms)
[   +1 ms] Synced 0.0MB.
[   +1 ms] <- accept
[   +2 ms] Connected to _flutterView/0x55ffd412a310.
[   +1 ms] Flutter run key commands.
[   +1 ms] r Hot reload. 🔥🔥🔥
[        ] R Hot restart.
[        ] h Repeat this help message.
[        ] d Detach (terminate "flutter run" but leave application
running).
[        ] c Clear the screen
[        ] q Quit (terminate the application on the device).
[        ] An Observatory debugger and profiler on Linux is
available at:
           http://127.0.0.1:39437/nmZoky0ydP8=/

Analyzing flutterfreeze...

   info • The value of the field '_counter' isn't used • lib/main.dart:29:7 • unused_field

1 issues found. (ran in 22.7s)
[✓] Flutter (Channel dev, 1.23.0-18.0.pre, on Linux, locale en_US.UTF-8)
    • Flutter version 1.23.0-18.0.pre at /opt/flutter
    • Framework revision 37ebe3d82a (4 days ago), 2020-10-13 10:52:23 -0700
    • Engine revision 6634406889
    • Dart version 2.11.0 (build 2.11.0-213.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /opt/android-sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /opt/android-sdk
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_265-b01)
    • All Android licenses accepted.

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.1
    • cmake version 3.18.4
    • ninja version 1.10.1
    • pkg-config version 1.7.3

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] Connected device (1 available)
    • Linux (desktop) • linux • linux-x64 • Linux

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopc: renderingUI glitches reported at the engine/skia or impeller rendering levele: device-specificOnly manifests on certain devicesengineflutter/engine related. See also e: labels.found in release: 1.23Found to occur in 1.23platform-linuxBuilding on or for Linux specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions