commit 06c18eebd98b90000b7763d73f37cbadb1466fbf
parent 698521820ea45c580cb8e81ba1322cee8cfad5c1
Author: falkTX <falktx@falktx.com>
Date: Wed, 11 Oct 2023 14:54:52 +0200
Add width, height args to puglFallbackOnResize
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
6 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/dgl/src/TopLevelWidgetPrivateData.cpp b/dgl/src/TopLevelWidgetPrivateData.cpp
@@ -135,9 +135,9 @@ bool TopLevelWidget::PrivateData::scrollEvent(const ScrollEvent& ev)
return selfw->pData->giveScrollEventForSubWidgets(rev);
}
-void TopLevelWidget::PrivateData::fallbackOnResize()
+void TopLevelWidget::PrivateData::fallbackOnResize(const uint width, const uint height)
{
- puglFallbackOnResize(window.pData->view);
+ puglFallbackOnResize(window.pData->view, width, height);
}
// -----------------------------------------------------------------------
diff --git a/dgl/src/TopLevelWidgetPrivateData.hpp b/dgl/src/TopLevelWidgetPrivateData.hpp
@@ -38,7 +38,7 @@ struct TopLevelWidget::PrivateData {
bool mouseEvent(const MouseEvent& ev);
bool motionEvent(const MotionEvent& ev);
bool scrollEvent(const ScrollEvent& ev);
- void fallbackOnResize();
+ void fallbackOnResize(uint width, uint height);
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData)
};
diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -537,10 +537,10 @@ void Window::onFocus(bool, CrossingMode)
{
}
-void Window::onReshape(uint, uint)
+void Window::onReshape(const uint width, const uint height)
{
if (pData->view != nullptr)
- puglFallbackOnResize(pData->view);
+ puglFallbackOnResize(pData->view, width, height);
}
void Window::onScaleFactorChanged(double)
diff --git a/dgl/src/pugl.cpp b/dgl/src/pugl.cpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -452,7 +452,7 @@ void puglOnDisplayPrepare(PuglView*)
// --------------------------------------------------------------------------------------------------------------------
// DGL specific, build-specific fallback resize
-void puglFallbackOnResize(PuglView* const view)
+void puglFallbackOnResize(PuglView* const view, uint, uint)
{
#ifdef DGL_OPENGL
glEnable(GL_BLEND);
@@ -624,6 +624,9 @@ void puglWin32ShowCentered(PuglView* const view)
#elif defined(HAVE_X11)
+// --------------------------------------------------------------------------------------------------------------------
+// X11 specific, update world without triggering exposure events
+
PuglStatus puglX11UpdateWithoutExposures(PuglWorld* const world)
{
const bool wasDispatchingEvents = world->impl->dispatchingEvents;
diff --git a/dgl/src/pugl.hpp b/dgl/src/pugl.hpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -19,7 +19,7 @@
#include "../Base.hpp"
-/* we will include all header files used in pugl.h in their C++ friendly form, then pugl stuff in custom namespace */
+// we will include all header files used in pugl.h in their C++ friendly form, then pugl stuff in custom namespace
#include <cstddef>
#ifdef DISTRHO_PROPER_CPP11_SUPPORT
# include <cstdbool>
@@ -71,7 +71,7 @@ PuglStatus puglSetSizeAndDefault(PuglView* view, uint width, uint height);
void puglOnDisplayPrepare(PuglView* view);
// DGL specific, build-specific fallback resize
-void puglFallbackOnResize(PuglView* view);
+void puglFallbackOnResize(PuglView* view, uint width, uint height);
#if defined(DISTRHO_OS_HAIKU)
@@ -104,7 +104,7 @@ void puglWin32ShowCentered(PuglView* view);
#define DGL_USING_X11
-// X11 specific, update world without triggering exposure evente
+// X11 specific, update world without triggering exposure events
PuglStatus puglX11UpdateWithoutExposures(PuglWorld* world);
// X11 specific, set dialog window type and pid hints
diff --git a/distrho/src/DistrhoUI.cpp b/distrho/src/DistrhoUI.cpp
@@ -404,10 +404,10 @@ void UI::uiFocus(bool, DGL_NAMESPACE::CrossingMode)
{
}
-void UI::uiReshape(uint, uint)
+void UI::uiReshape(const uint width, const uint height)
{
// NOTE this must be the same as Window::onReshape
- pData->fallbackOnResize();
+ pData->fallbackOnResize(width, height);
}
#endif // !DISTRHO_PLUGIN_HAS_EXTERNAL_UI