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

Window flashes when startup since version 0.3.7 on Windows #504

Open
chenghang6 opened this issue Oct 25, 2024 · 2 comments
Open

Window flashes when startup since version 0.3.7 on Windows #504

chenghang6 opened this issue Oct 25, 2024 · 2 comments

Comments

@chenghang6
Copy link

chenghang6 commented Oct 25, 2024

Window flashes when startup since version 0.3.7 on Windows.
WindowOptions is set with "center: true" and "titleBarStyle: TitleBarStyle.hidden".
It seems that the window is initially located somewhere else, then moved to the center.

import 'package:flutter/material.dart';
import 'package:window_manager/window_manager.dart';
import 'package:screen_retriever/screen_retriever.dart';
import 'dart:io';

const windowWidthRatio = 0.65;
const windowHeightRatio = 0.75;

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

  await windowManager.ensureInitialized();

  var primaryDisplay = await screenRetriever.getPrimaryDisplay();

  runApp(Material(child: Container()));

  var screenSize = primaryDisplay.size;
  double windowWidth = screenSize.width * windowWidthRatio;
  double windowHeight = screenSize.height * windowHeightRatio;

  WindowOptions windowOptions = WindowOptions(
    size: Size(windowWidth, windowHeight),
    center: true,
    titleBarStyle: TitleBarStyle.hidden,
  );

  windowManager.waitUntilReadyToShow(windowOptions, () async {
    await windowManager.show();
    await windowManager.focus();
  });
}

  window_manager: ^0.4.0
@chenghang6 chenghang6 changed the title Window with hidden title bar flashes when startup since version 0.4.0 Window when startup since version 0.4.0 on Windows Oct 25, 2024
@chenghang6 chenghang6 changed the title Window when startup since version 0.4.0 on Windows Window flashes when startup since version 0.4.0 on Windows Oct 25, 2024
@chenghang6 chenghang6 changed the title Window flashes when startup since version 0.4.0 on Windows Window flashes when startup since version 0.3.7 on Windows Oct 25, 2024
@chenghang6
Copy link
Author

chenghang6 commented Oct 25, 2024

After testing, I am pretty sure it's introduced by commit: 609df9d

@tonka3000
Copy link

tonka3000 commented Nov 6, 2024

I have the same issue, but only in Debug mode. Release mode seems not to be affected.
I use 0.4.2. Also tried 0.4.3, still the same issue.

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