Skip to content

Commit

Permalink
[Winforms] Remove white border in fullscreen window
Browse files Browse the repository at this point in the history
  • Loading branch information
r0x0r committed Sep 4, 2024
1 parent 26db906 commit ca10170
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions webview/platforms/winforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,10 @@ def _toggle():
self.old_screen.Bounds.Height,
64,
)
# disable window rounding
DwmSetWindowAttribute(self.Handle.ToInt32(), 33, 1)
# hide window border
DwmSetWindowAttribute(self.Handle.ToInt32(), 34, 0xFFFFFFFE)
else:
self.WindowState = WinForms.FormWindowState.Normal
self.FormBorderStyle = self.old_style
Expand All @@ -485,6 +489,11 @@ def _toggle():
self.Location = self.old_location
self.Size = self.old_size

# enable window rounding
DwmSetWindowAttribute(self.Handle.ToInt32(), 33, 0)
# show window border
DwmSetWindowAttribute(self.Handle.ToInt32(), 34, 0xFFFFFFFF)

if self.InvokeRequired:
self.Invoke(Func[Type](_toggle))
else:
Expand Down

0 comments on commit ca10170

Please sign in to comment.