diff --git a/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp b/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp index 8af324e2e5..a1276a4649 100644 --- a/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp +++ b/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp @@ -401,14 +401,9 @@ public: return {}; } - void startResizing() + void setResizing (bool x) { - resizing = true; - } - - void finishResizing() - { - resizing = false; + resizing = x; } void setSize (Rectangle size) @@ -692,14 +687,9 @@ void Direct2DHwndContext::setWindowAlpha (float alpha) pimpl->setTargetAlpha (alpha); } -void Direct2DHwndContext::startResizing() +void Direct2DHwndContext::setResizing (bool x) { - pimpl->startResizing(); -} - -void Direct2DHwndContext::finishResizing() -{ - pimpl->finishResizing(); + pimpl->setResizing (x); } void Direct2DHwndContext::setSize (int width, int height) diff --git a/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.h b/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.h index 5461236bf6..6088378114 100644 --- a/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.h +++ b/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.h @@ -45,8 +45,7 @@ public: void handleShowWindow(); void setWindowAlpha (float alpha); - void startResizing(); - void finishResizing(); + void setResizing (bool); void setSize (int width, int height); void updateSize(); diff --git a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp index bbda56ccce..49296f602d 100644 --- a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp +++ b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp @@ -1456,8 +1456,7 @@ struct RenderContext virtual void dispatchDeferredRepaints() = 0; virtual void performAnyPendingRepaintsNow() = 0; virtual void onVBlank() = 0; - virtual void beginResize() = 0; - virtual void endResize() = 0; + virtual void setResizing (bool) = 0; virtual void handleNcCalcSize (WPARAM wParam, LPARAM lParam) = 0; virtual void handleShowWindow() = 0; virtual std::optional getNcHitTestResult() = 0; @@ -3676,20 +3675,19 @@ private: break; - case WM_ENTERSIZEMOVE: - if (renderContext != nullptr) - renderContext->beginResize(); - - break; - case WM_EXITSIZEMOVE: if (renderContext != nullptr) - renderContext->endResize(); + renderContext->setResizing (false); break; //============================================================================== - case WM_SIZING: return handleSizeConstraining (*(RECT*) lParam, wParam); + case WM_SIZING: + if (renderContext != nullptr) + renderContext->setResizing (true); + + return handleSizeConstraining (*(RECT*) lParam, wParam); + case WM_WINDOWPOSCHANGING: return handlePositionChanging (*(WINDOWPOS*) lParam); case 0x2e0: /* WM_DPICHANGED */ return handleDPIChanging ((int) HIWORD (wParam), *(RECT*) lParam); @@ -4469,8 +4467,7 @@ public: return {}; } - void beginResize() override {} - void endResize() override {} + void setResizing (bool) override {} void handleNcCalcSize (WPARAM, LPARAM) override {} void handleShowWindow() override {} @@ -4728,14 +4725,9 @@ public: std::optional getNcHitTestResult() override { return {}; } - void beginResize() override + void setResizing (bool x) override { - direct2DContext->startResizing(); - } - - void endResize() override - { - direct2DContext->finishResizing(); + direct2DContext->setResizing (x); } void handleNcCalcSize (WPARAM, LPARAM lParam) override