Skip to content

Commit

Permalink
better windo manager integration
Browse files Browse the repository at this point in the history
  • Loading branch information
zenoxs committed May 2, 2022
1 parent 6e14c53 commit 51b8fe6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions macos/Runner/MainFlutterWindow.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Cocoa
import FlutterMacOS
import flutter_acrylic
import window_manager

class MainFlutterWindow: NSWindow {
override func awakeFromNib() {
Expand All @@ -16,4 +17,9 @@ class MainFlutterWindow: NSWindow {

super.awakeFromNib()
}

override public func order(_ place: NSWindow.OrderingMode, relativeTo otherWin: Int) {
super.order(place, relativeTo: otherWin)
hiddenWindowAtLaunch()
}
}
3 changes: 2 additions & 1 deletion windows/runner/win32_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ bool Win32Window::CreateAndShow(const std::wstring& title,
double scale_factor = dpi / 96.0;

HWND window = CreateWindow(
window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE,
window_class, title.c_str(),
WS_OVERLAPPEDWINDOW, // do not add WS_VISIBLE since the window will be shown later
Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
Scale(size.width, scale_factor), Scale(size.height, scale_factor),
nullptr, nullptr, GetModuleHandle(nullptr), this);
Expand Down

0 comments on commit 51b8fe6

Please # to comment.