10

I'm building a transparent app using Flutter Desktop for Linux, is there a way to click through the main app window, still showing the app? I'm trying to write some kind of overlay app.

I've tried using the IgnorePointer widget on the root widget but that still doesn't forward the click events behind the window.

I assume there's some kind of binding to add in the application.cc file.

Pacane
  • 20,273
  • 18
  • 60
  • 97
  • Did you find a solution? – Marwin Lebensky Apr 18 '22 at 18:51
  • 1
    Not really no. I ended up doing a poor hack which was setting the opacity of both my windows to transparent with my overlay window under the other. But that's more of a hack than a real solution – Pacane Apr 19 '22 at 19:28
  • 1
    https://stackoverflow.com/questions/71096699/letting-the-mouse-pass-through-windows-flutter the first link in this answer shows a good library to use. Allows you to manage the window, one option being to click through the window. The second link is demo of how it works in real time from the creators twitter account – David May 03 '22 at 19:43
  • I've checked this ^ thanks to you, but it's not yet supported for Linux it seems. I'll leave the question open. – Pacane Aug 19 '22 at 18:57
  • now it has a Linux support @Pacane – MANISH DAYMA Oct 27 '22 at 12:53
  • @Manish Dayma no, it's not – FreeStyler Jan 15 '23 at 08:13
  • In order to make a transparent app window in Flutter Desktop for Linux, you will need to set the transparent property to true in the window object of your main.dart file. This will make the window transparent, allowing clicks to pass through. Regarding the binding to add in the application.cc file, you may have to use the gtk_widget_set_app_paintable() function to set the GTK widget of your Flutter app as paintable. Then you can use the gtk_widget_set_opacity() function to set the opacity of the widget to a value less than 1.0 to make it transparent. – ilia khuzhakhmetov Jan 23 '23 at 12:14

0 Answers0