Flutter: Don't take focus away from current window when my flutter window is clicked

Viewed 159

Basically I'm creating a tiny button on the side and I want it to not get focused when clicked.

So for example if the user is on some random application, they should still be able to type in that application after clicking on my tiny button window without having to click on their application back again.

3 Answers

The only way I know to have an app running without taking the whole focus is to define your app as a "background" app.
To do so, add

    <key>LSBackgroundOnly</key>
    <string>True</string>

to the Info.plist (which is located in your macos/Runner folder)

This solution has some drawbacks though, but at least you'll have the behavior you're looking for.

Related