From 3e70c37ce37c16a6b64b4fcc531e57b333fce21b Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 18 Jun 2025 20:08:24 +0100 Subject: [PATCH] Windows: Disable window decorations for kiosk-mode windows This fixes an issue where kiosk-mode windows would incorrectly receive rounded corners and a 1px transparent border. --- .../native/juce_Windowing_windows.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp index 4709b52161..f8268f6c6d 100644 --- a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp +++ b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp @@ -2551,10 +2551,16 @@ private: bool windowUsesNativeShadow() const { - return hasTitleBar() - || ( (0 != (styleFlags & windowHasDropShadow)) - && (0 == (styleFlags & windowIsSemiTransparent)) - && (0 == (styleFlags & windowIsTemporary))); + if (hasTitleBar()) + return true; + + // On Windows 11, the native drop shadow also gives us a 1px transparent border and rounded + // corners, which doesn't look great in kiosk mode. Disable the native shadow for + // fullscreen windows. + return Desktop::getInstance().getKioskModeComponent() != &component + && (0 != (styleFlags & windowHasDropShadow)) + && (0 == (styleFlags & windowIsSemiTransparent)) + && (0 == (styleFlags & windowIsTemporary)); } void updateShadower()