media-kit / media-kit

A cross-platform video player & audio player for Flutter & Dart.
https://github.com/media-kit/media-kit
MIT License
893 stars 126 forks source link

windows fullscreen is abnormal when use window_manager set titlebar hide #770

Closed lunxinfeng closed 1 month ago

lunxinfeng commented 1 month ago

enter fullscreen on windows, the edges will has blank when use window_manager set titlebar hide, I donot understand the windows sdk, can you help me?

fullscreen

` ``yaml dependencies: media_kit: ^1.1.10 # Primary package. media_kit_video: ^1.2.4 # For video rendering. media_kit_libs_video: ^1.0.4
window_manager: ^0.3.8


here is the setTitleBar code  from window_manager:
```c++
void WindowManager::SetTitleBarStyle(const flutter::EncodableMap& args) {
  title_bar_style_ =
      std::get<std::string>(args.at(flutter::EncodableValue("titleBarStyle")));
  // Enables the ability to go from setAsFrameless() to
  // TitleBarStyle.normal/hidden
  is_frameless_ = false;

  MARGINS margins = {0, 0, 0, 0};
  HWND hWnd = GetMainWindow();
  RECT rect;
  GetWindowRect(hWnd, &rect);
  DwmExtendFrameIntoClientArea(hWnd, &margins);
  SetWindowPos(hWnd, nullptr, rect.left, rect.top, 0, 0,
               SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE |
                   SWP_FRAMECHANGED);
}
lunxinfeng commented 1 month ago

The problem should be with window_manager, I will close this issue first