DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit 52034ae7244689bd83445f3eafa533362b978c8d
parent 9e6b86b7f2e177d38d4efc4e53173624bbde486a
Author: falkTX <falktx@gmail.com>
Date:   Sun,  4 Jan 2015 04:43:04 +0000

Modal and other misc fixes from Carla

Diffstat:
Mdgl/ImageAboutWindow.hpp | 3++-
Mdgl/src/ImageAboutWindow.cpp | 8++++----
Mdgl/src/Window.cpp | 35+++++++++++++++++++++++------------
3 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/dgl/ImageAboutWindow.hpp b/dgl/ImageAboutWindow.hpp @@ -43,7 +43,8 @@ protected: private: Image fImgBackground; - DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImageAboutWindow) + DISTRHO_DECLARE_NON_COPY_CLASS(ImageAboutWindow) + //DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImageAboutWindow) }; // ----------------------------------------------------------------------- diff --git a/dgl/src/ImageAboutWindow.cpp b/dgl/src/ImageAboutWindow.cpp @@ -23,8 +23,8 @@ START_NAMESPACE_DGL ImageAboutWindow::ImageAboutWindow(Window& parent, const Image& image) : Window(parent.getApp(), parent), Widget((Window&)*this), - fImgBackground(image), - leakDetector_ImageAboutWindow() + fImgBackground(image)/*, + leakDetector_ImageAboutWindow()*/ { Window::setResizable(false); Window::setSize(static_cast<uint>(image.getWidth()), static_cast<uint>(image.getHeight())); @@ -34,8 +34,8 @@ ImageAboutWindow::ImageAboutWindow(Window& parent, const Image& image) ImageAboutWindow::ImageAboutWindow(Widget* widget, const Image& image) : Window(widget->getParentApp(), widget->getParentWindow()), Widget((Window&)*this), - fImgBackground(image), - leakDetector_ImageAboutWindow() + fImgBackground(image)/*, + leakDetector_ImageAboutWindow()*/ { Window::setResizable(false); Window::setSize(static_cast<uint>(image.getWidth()), static_cast<uint>(image.getHeight())); diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp @@ -227,7 +227,12 @@ struct Window::PrivateData { { DBG("Destroying window..."); DBGF; - //fOnModal = false; + if (fModal.enabled) + { + exec_fini(); + close(); + } + fWidgets.clear(); if (fUsingEmbed) @@ -687,9 +692,9 @@ struct Window::PrivateData { Widget::SpecialEvent ev; ev.press = press; - ev.key = key; - ev.mod = static_cast<Modifier>(puglGetModifiers(fView)); - ev.time = puglGetEventTimestamp(fView); + ev.key = key; + ev.mod = static_cast<Modifier>(puglGetModifiers(fView)); + ev.time = puglGetEventTimestamp(fView); FOR_EACH_WIDGET_INV(rit) { @@ -704,14 +709,17 @@ struct Window::PrivateData { { DBGp("PUGL: onMouse : %i %i %i %i\n", button, press, x, y); + // FIXME - pugl sends 2 of these for each window on init, don't ask me why. we'll ignore it + if (press && button == 0 && x == 0 && y == 0) return; + if (fModal.childFocus != nullptr) return fModal.childFocus->focus(); Widget::MouseEvent ev; ev.button = button; - ev.press = press; - ev.mod = static_cast<Modifier>(puglGetModifiers(fView)); - ev.time = puglGetEventTimestamp(fView); + ev.press = press; + ev.mod = static_cast<Modifier>(puglGetModifiers(fView)); + ev.time = puglGetEventTimestamp(fView); FOR_EACH_WIDGET_INV(rit) { @@ -773,7 +781,7 @@ struct Window::PrivateData { { DBGp("PUGL: onReshape : %i %i\n", width, height); - if (width == 1 && height == 1) + if (width <= 1 && height <= 1) return; fWidth = width; @@ -794,7 +802,7 @@ struct Window::PrivateData { { DBG("PUGL: onClose\n"); - if (fModal.enabled && fModal.parent != nullptr) + if (fModal.enabled) exec_fini(); fSelf->onClose(); @@ -906,13 +914,16 @@ struct Window::PrivateData { // Window Window::Window(App& app) - : pData(new PrivateData(app, this)) {} + : pData(new PrivateData(app, this)), + leakDetector_Window() {} Window::Window(App& app, Window& parent) - : pData(new PrivateData(app, this, parent)) {} + : pData(new PrivateData(app, this, parent)), + leakDetector_Window() {} Window::Window(App& app, intptr_t parentId) - : pData(new PrivateData(app, this, parentId)) {} + : pData(new PrivateData(app, this, parentId)), + leakDetector_Window() {} Window::~Window() {