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

windows: do not show border radius #470

Open
maldag opened this issue Jul 9, 2024 · 0 comments
Open

windows: do not show border radius #470

maldag opened this issue Jul 9, 2024 · 0 comments

Comments

@maldag
Copy link

maldag commented Jul 9, 2024

I didn't find a way to create a window in windows without border radius on windows without using frameless-Mode. Using frameless-mode the window will have corners, but I need the title bar and a movable widget.
Is there a way to get this working on windows?

Update1:

I fiddled around in the code a bit and found a way to accomplish this:

diff --git a/windows/window_manager.cpp b/windows/window_manager.cpp
index a27fc4f..cda998d 100644
--- a/windows/window_manager.cpp
+++ b/windows/window_manager.cpp
@@ -755,6 +755,12 @@ void WindowManager::SetBounds(const flutter::EncodableMap& args) {
   }
 
   SetWindowPos(hwnd, HWND_TOP, x, y, width, height, uFlags);
+  DWM_WINDOW_CORNER_PREFERENCE cornerPreference = DWM_WINDOW_CORNER_PREFERENCE::DWMWCP_DONOTROUND;
+  DwmSetWindowAttribute(hwnd,
+    DWMWA_WINDOW_CORNER_PREFERENCE,
+    &cornerPreference,
+    sizeof(cornerPreference)
+  );
 }

So my question would no be how this could be included in a proper way by the maintainers?

The window is still smaller as the size given, it seems to me it's subtracting some pixels for the corner ...

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

1 participant