Skip to content
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

Window flickering when using trackpad gestures. #12

Open
whiskeyPeak opened this issue Nov 27, 2022 · 13 comments
Open

Window flickering when using trackpad gestures. #12

whiskeyPeak opened this issue Nov 27, 2022 · 13 comments

Comments

@whiskeyPeak
Copy link

I'm experiencing a lot of window flickering mainly whenever there is a lot of scrolling in the app, although it also happens when doing other normal operations. The window titlebar also doesn't render the close/expand/minimise buttons.

This is happening on Linux Mint Debian Edition 5 Cinnamon, on a Dell XPS 15 9500. I'm using the nouveau drivers for my Nvidia graphics card.

simplescreenrecorder-2022-11-27_15.20.33.mp4

flutter doctor:

[✓] Flutter (Channel stable, 3.3.9, on LMDE 5 (elsie) 5.10.0-19-amd64, locale
    en_GB.UTF-8)
    • Flutter version 3.3.9 on channel stable at
      /home/henryr/Dev/SDK/Flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b8f7f1f986 (5 days ago), 2022-11-23 06:43:51 +0900
    • Engine revision 8f2221fbef
    • Dart version 2.18.5
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /home/henryr/Android/Sdk
    • Platform android-33, build-tools 32.1.0-rc1
    • Java binary at: /home/henryr/Dev/SDK/AndroidStudio/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Debian clang version 11.0.1-2
    • cmake version 3.18.4
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2021.2)
    • Android Studio at /home/henryr/Dev/SDK/AndroidStudio/android-studio
    • Flutter plugin version 71.0.2
    • Dart plugin version 212.5744
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • LMDE 5 (elsie) 5.10.0-19-amd64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 107.0.5304.110

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Reproduceable code:

import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
        debugShowCheckedModeBanner: false, home: ListViewBuilder());
  }
}

class ListViewBuilder extends StatelessWidget {
  const ListViewBuilder({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("Flickering bug")),
      body: ListView.builder(
          itemCount: 100,
          itemBuilder: (BuildContext context, int index) {
            return ListTile(
                leading: const Icon(Icons.list),
                trailing: const Text(
                  "GFG",
                  style: TextStyle(color: Colors.green, fontSize: 15),
                ),
                title: Text("List item $index"));
          }),
    );
  }
}

cc @Feichtmeier

@Feichtmeier
Copy link
Member

The interesting part should be my_application.cc and whether this does not happen without habdy_window

The noveau driver also caused a lot of issues from my expenses in general. Did you try a different driver?

@jpnurmi
Copy link
Member

jpnurmi commented Nov 28, 2022

Could you try installing handy-1-examples and try if the rendering issues are reproducible when running /usr/bin/handy-1-demo, please?

EDIT: Oops, nevermind, you said Mint. packages.linuxmint.com gives 0 results for "handy" 👀

@whiskeyPeak
Copy link
Author

Could you try installing handy-1-examples and try if the rendering issues are reproducible when running /usr/bin/handy-1-demo, please?

That package is actually in the Debian repo as well! I ran it and saw no flickering at all. Debian Bullseye (what Linux Mint DE 5 is based on) uses a really old version of libhandy (1.0.3-2). The testing repo uses libhandy 1.8.0-1. I'll see if upgrading that package fixes anything.

The noveau driver also caused a lot of issues from my expenses in general. Did you try a different driver?

I blacklisted the Nvidia GPU from my system and the issue is still occurring

The interesting part should be my_application.cc and whether this does not happen without habdy_window

Yeah, the default GTK window works completely fine, it's only when I switch to the handy window that I start seeing the flickering.

@jpnurmi
Copy link
Member

jpnurmi commented Nov 28, 2022

Glad to hear that the basic handy demo works. A more interesting test case would be HdyWindow + GtkGLArea because it'd be closer to the structure of a Flutter application with this package enabled. I'm not sure if there's any ready-made test case for that, though.

@whiskeyPeak
Copy link
Author

Upgraded the libhandy package and I still get the flickering.

@Feichtmeier
Copy link
Member

@whiskeyPeak

I didn't get this part

I blacklisted the Nvidia GPU from my system and the issue is still occurring

I would be interested in seeing if this flickering with libhandy and flutter also happens if you change your driver to the official nvidia driver - sorry if you said this and I just did not understand it

@whiskeyPeak
Copy link
Author

whiskeyPeak commented Nov 28, 2022

I would be interested in seeing if this flickering with libhandy and flutter also happens if you change your driver to the official nvidia driver - sorry if you said this and I just did not understand it

The issue still occurs on the Nvidia Nouveau driver, the proprietary Nvidia driver and the Intel integrated GPU.

Something interesting is that the flickering goes away if the window is maximised, or tiled on the sides/corner.

@Feichtmeier
Copy link
Member

I would be interested in seeing if this flickering with libhandy and flutter also happens if you change your driver to the official nvidia driver - sorry if you said this and I just did not understand it

The issue is occurs on the Nvidia Nouveau driver, the proprietary Nvidia driver and the Intel integrated GPU.

Something interesting is that the flickering goes away if the window is maximised, or tiled on the sides/corner.

WHat happens if you remove the gtk header bar entirely in my_application.cc ?

@whiskeyPeak
Copy link
Author

WHat happens if you remove the gtk header bar entirely in my_application.cc ?

Issue still persists unfortunately

@whiskeyPeak
Copy link
Author

Forcing it to use a GTK header bar also doesn't fix the issue, although it does give me close, maximize, minimize buttons.

@jpnurmi
Copy link
Member

jpnurmi commented Nov 28, 2022

How does the app behave if you set GTK_CSD=0 environment variable?

@whiskeyPeak
Copy link
Author

I get the same handy window with the same issues

@whiskeyPeak
Copy link
Author

whiskeyPeak commented Feb 11, 2023

I tested a base flutter handy window with a scrollview on Fedora(Gnome/Cinnamon), Linux Mint(Cinnamon) and Ubuntu(Gnome/Cinnamon) and in each case, the flickering occurred on the Cinnamon version of the distro. The Gnome version was completely ok and even seemed to run faster.

Edit:
I just tested this on Linux Mint 20 Cinnamon (about 2 and half years old now) and the window isn't flickering. This is definitely a regression though it's going to be hard to pinpoint exactly where it is coming from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants