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

Mica does not react to window blurring when title bar is hidden #42

Closed
beta opened this issue Nov 15, 2022 · 3 comments
Closed

Mica does not react to window blurring when title bar is hidden #42

beta opened this issue Nov 15, 2022 · 3 comments

Comments

@beta
Copy link

beta commented Nov 15, 2022

Hi, I'm using flutter_acrylic together with window_manager. My main() function writes as shown below.

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Window.initialize();

  await windowManager.ensureInitialized();
  const windowOptions = WindowOptions(
    title: _appName,
    size: Size(800, 600),
    center: true,
    // titleBarStyle: TitleBarStyle.hidden, // <- this line is the case
  );
  await windowManager.waitUntilReadyToShow(windowOptions, () async {
    await windowManager.show();
    await windowManager.focus();
  });

  runApp(const GalleryApp());
}

And in my app widget's initState():

  @override
  void initState() {
    super.initState();

    Window.setEffect(
      effect: WindowEffect.mica,
      dark: FluffApp.dark,
    );
  }

With titleBarStyle: TitleBarStyle.normal (the default value), mica works perfectly and turns solid properly when the window is blurred (losing focus).

  • Focused
    image
  • Blurred
    image

However after I set titleBarStyle: TitleBarStyle.hidden, the mica background does not react to focus changes any more.

  • Focused
    image
  • Blurred. The focus is in the terminal app, but tbe mica background is still transparent.
    image

Please help to look into this problem, and let me know if I'm doing anything wrong. Thanks in advance.

@beta
Copy link
Author

beta commented Nov 15, 2022

Environment: Flutter 3.3.8 (Channel stable) and Windows 11 22H2 (22621.819)

@alexmercerind
Copy link
Owner

I can't say anything unfortunately without getting into depth. I will still suspect package:window_manager. Window behaviour is closely tied with native Win32 calls.

@beta
Copy link
Author

beta commented Nov 15, 2022

Tested with bitsdojo_window and the background is working correctly. I will close this issue and dig into the code of window_manager to see why.

@beta beta closed this as completed Nov 15, 2022
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

2 participants