Browse Source

Modal and other misc fixes from Carla

gh-pages
falkTX 11 years ago
parent
commit
52034ae724
3 changed files with 29 additions and 17 deletions
  1. +2
    -1
      dgl/ImageAboutWindow.hpp
  2. +4
    -4
      dgl/src/ImageAboutWindow.cpp
  3. +23
    -12
      dgl/src/Window.cpp

+ 2
- 1
dgl/ImageAboutWindow.hpp View File

@@ -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)
};

// -----------------------------------------------------------------------


+ 4
- 4
dgl/src/ImageAboutWindow.cpp View File

@@ -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()));


+ 23
- 12
dgl/src/Window.cpp View File

@@ -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()
{


Loading…
Cancel
Save