Letting the mouse pass through Windows Flutter

101

You can do it using the setIgnoreMouseEvents method of window_manager

https://github.com/leanflutter/window_manager

https://twitter.com/lijy91/status/1502115704677433353

Share:
101
Anas-Qasem
Author by

Anas-Qasem

Updated on January 03, 2023

Comments

  • Anas-Qasem
    Anas-Qasem 10 months

    I am working on a Flutter Desktop screen Annotation Application where I want to ignore the mouse events and let is pass through the window (so I can click on desktop application shortcut) when the icon(Red Box) Activated, and ignore it when one of the options in the blue box is activated. I am using flutter_acrylic to make the window transparent, and I know that I should use win32 to handle this functionality. but I really don't know the way to do that :(enter image description here

    Thanks in advance for the help.

    • IInspectable
      IInspectable over 1 year
      Use a layered window instead: "Hit testing of a layered window is based on the shape and transparency of the window. This means that the areas of the window that are color-keyed or whose alpha value is zero will let the mouse messages through."
    • jtxkopt
      jtxkopt over 1 year
      I am not sure but 'WS_EX_TRANSPARENT' may be another option.
    • IInspectable
      IInspectable over 1 year
    • Anas-Qasem
      Anas-Qasem over 1 year
      How I can get the hWnd inside flutter files ?
    • Jeaninez - MSFT
      Jeaninez - MSFT over 1 year
      @Anas-Qasem You could refer to the thread: stackoverflow.com/a/59440034/11872808