1

I'm looking to implement a Flutter Desktop application that allows a transparent window which forwards all touch events, like Zoom screen share.

My understanding is the behaviour can be achieved in electron using:

mainWindow.setIgnoreMouseEvents(true);

  const el = document.getElementById('clickThroughElement');
  el.addEventListener('mouseenter', () => {
    mainWindow.setIgnoreMouseEvents(true, { forward: true });
  });
  el.addEventListener('mouseleave', () => {
    mainWindow.setIgnoreMouseEvents(false);
  });
};

With Flutter Desktop still being in Alpha,

  1. Is this feature possible?
  2. Is there another approach?
  3. Is it on the feature radar?
MousyBusiness
  • 188
  • 2
  • 14

1 Answers1

0

you need to change the native C++ code specifically in

windows\runner\win32_window.cpp

and comment's the SetWindowLongPtr() function and add the following code

int extendedStyleSettings = GetWindowLong(window,GWL_EXSTYLE);
SetWindowLong(window,GWL_EXSTYLE, extendedStyleSettings | WS_EX_LAYERED | WS_EX_TRANSPARENT);
SetLayeredWindowAttributes(window, 0, 255, LWA_ALPHA);

The problem with this solution is I don't know how to get the mouse event back because this solution edit's the win32api window which initiating in the begging of the running app and hosting the flutter view

Anas-Qasem
  • 185
  • 10