From 5c1b75cab7473e08ed0dacc62a66f603ba7e6783 Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 1 Jul 2024 19:01:21 +0100 Subject: [PATCH] Platform: Remove compatibility checks for Windows 8.1 and earlier --- .../audio_io/juce_AudioIODeviceType.cpp | 6 ------ .../native/juce_FileChooser_windows.cpp | 13 +++++-------- .../native/juce_NativeMessageBox_windows.cpp | 3 --- .../native/juce_Windowing_windows.cpp | 14 ++------------ .../juce_gui_extra/misc/juce_WebBrowserComponent.h | 3 +-- 5 files changed, 8 insertions(+), 31 deletions(-) diff --git a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp index ba6f3bba13..bdb23c8b0d 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp +++ b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp @@ -69,12 +69,6 @@ void AudioIODeviceType::callDeviceChangeListeners() #if JUCE_WINDOWS && JUCE_WASAPI AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_WASAPI (WASAPIDeviceMode deviceMode) { - auto windowsVersion = SystemStats::getOperatingSystemType(); - - if (windowsVersion < SystemStats::WinVista - || (WasapiClasses::isLowLatencyMode (deviceMode) && windowsVersion < SystemStats::Windows10)) - return nullptr; - return new WasapiClasses::WASAPIAudioIODeviceType (deviceMode); } diff --git a/modules/juce_gui_basics/native/juce_FileChooser_windows.cpp b/modules/juce_gui_basics/native/juce_FileChooser_windows.cpp index 8433042439..0801b061d3 100644 --- a/modules/juce_gui_basics/native/juce_FileChooser_windows.cpp +++ b/modules/juce_gui_basics/native/juce_FileChooser_windows.cpp @@ -342,7 +342,7 @@ private: } //============================================================================== - Array openDialogVistaAndUp() + Array openDialogWithoutPreview() { const auto getUrl = [] (IShellItem& item) { @@ -431,7 +431,7 @@ private: return result; } - Array openDialogPreVista (bool async) + Array openDialogWithPreview (bool async) { Array selections; @@ -546,13 +546,10 @@ private: const Remover remover (*this); - if (SystemStats::getOperatingSystemType() >= SystemStats::WinVista - && customComponent == nullptr) - { - return openDialogVistaAndUp(); - } + if (customComponent == nullptr) + return openDialogWithoutPreview(); - return openDialogPreVista (async); + return openDialogWithPreview (async); } void run() override diff --git a/modules/juce_gui_basics/native/juce_NativeMessageBox_windows.cpp b/modules/juce_gui_basics/native/juce_NativeMessageBox_windows.cpp index a178aaad13..7f35cdc026 100644 --- a/modules/juce_gui_basics/native/juce_NativeMessageBox_windows.cpp +++ b/modules/juce_gui_basics/native/juce_NativeMessageBox_windows.cpp @@ -216,9 +216,6 @@ std::unique_ptr ScopedMessageBoxInterface::create (co static const auto result = [&]() -> TaskDialogIndirectFunc { - if (SystemStats::getOperatingSystemType() < SystemStats::WinVista) - return nullptr; - const auto comctl = "Comctl32.dll"; LoadLibraryA (comctl); const auto comctlModule = GetModuleHandleA (comctl); diff --git a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp index 1bb395a5f0..7e0600811c 100644 --- a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp +++ b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp @@ -2563,8 +2563,7 @@ private: void updateShadower() { - if (! component.isCurrentlyModal() && (styleFlags & windowHasDropShadow) != 0 - && ((! hasTitleBar()) || SystemStats::getOperatingSystemType() < SystemStats::WinVista)) + if (! component.isCurrentlyModal() && (styleFlags & windowHasDropShadow) != 0 && ! hasTitleBar()) { shadower = component.getLookAndFeel().createDropShadowerForComponent (component); @@ -2616,14 +2615,6 @@ private: int getCurrentRenderingEngine() const override; void setCurrentRenderingEngine (int e) override; - static uint32 getMinTimeBetweenMouseMoves() - { - if (SystemStats::getOperatingSystemType() >= SystemStats::WinVista) - return 0; - - return 1000 / 60; // Throttling the incoming mouse-events seems to still be needed in XP.. - } - bool isTouchEvent() noexcept { if (registerTouchWindow == nullptr) @@ -2689,13 +2680,12 @@ private: } static uint32 lastMouseTime = 0; - static auto minTimeBetweenMouses = getMinTimeBetweenMouseMoves(); auto now = Time::getMillisecondCounter(); if (! Desktop::getInstance().getMainMouseSource().isDragging()) modsToSend = modsToSend.withoutMouseButtons(); - if (now >= lastMouseTime + minTimeBetweenMouses) + if (now >= lastMouseTime) { lastMouseTime = now; doMouseEvent (position, MouseInputSource::defaultPressure, diff --git a/modules/juce_gui_extra/misc/juce_WebBrowserComponent.h b/modules/juce_gui_extra/misc/juce_WebBrowserComponent.h index 8df5fa4879..5ab30052d0 100644 --- a/modules/juce_gui_extra/misc/juce_WebBrowserComponent.h +++ b/modules/juce_gui_extra/misc/juce_WebBrowserComponent.h @@ -187,8 +187,7 @@ public: /** Sets the background colour that WebView2 renders underneath all web content. - This colour must either be fully opaque or transparent. On Windows 7 this - colour must be opaque. + This colour must either be fully opaque or fully transparent. */ [[nodiscard]] WinWebView2 withBackgroundColour (const Colour& colour) const {