Skip to content

Commit

Permalink
Add width, height args to puglFallbackOnResize
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Oct 11, 2023
1 parent 6985218 commit 06c18ee
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions dgl/src/TopLevelWidgetPrivateData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

// -----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion dgl/src/TopLevelWidgetPrivateData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
Expand Down
6 changes: 3 additions & 3 deletions dgl/src/Window.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2022 Filipe Coelho <[email protected]>
* Copyright (C) 2012-2023 Filipe Coelho <[email protected]>
*
* 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
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions dgl/src/pugl.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2022 Filipe Coelho <[email protected]>
* Copyright (C) 2012-2023 Filipe Coelho <[email protected]>
*
* 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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions dgl/src/pugl.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2022 Filipe Coelho <[email protected]>
* Copyright (C) 2012-2023 Filipe Coelho <[email protected]>
*
* 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
Expand All @@ -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>
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions distrho/src/DistrhoUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 06c18ee

Please sign in to comment.