DPF icon indicating copy to clipboard operation
DPF copied to clipboard

Application freezes on macOS when calling repaint() in onNanoDisplay

Open hpfmn opened this issue 3 years ago • 9 comments

Hi,

when repaint() is called inside of a onNanoDisplay callback the application freezes on macOS. Seems that the draw queue gets filled up with to many requests. I'm not totally sure if that is bug or these situations should be handled differently? An example where this happens is wolf-spectrum - see https://github.com/wolf-plugins/wolf-spectrum/issues/54

Best regards, Johannes

hpfmn avatar Feb 22 '22 15:02 hpfmn

on macOS things are a bit weird with repaints, it always does so even if you never call repaint. seems to be a bug in pugl

falkTX avatar Feb 22 '22 15:02 falkTX

Are you referring to this? https://github.com/lv2/pugl/issues/56

hpfmn avatar Feb 22 '22 15:02 hpfmn

What would you recommend to do about it? Open a bug report at pugl? If I'm getting rid of all repaint calls in wolf-spectrogram it does work for me on macOS. But repaint is also called in

void SubWidget::setAbsolutePos(const Point<int>& pos) noexcept
{
    if (pData->absolutePos == pos)
        return;

    PositionChangedEvent ev;
    ev.oldPos = pData->absolutePos;
    ev.pos = pos;

    pData->absolutePos = pos;
    onPositionChanged(ev);

    repaint();
}

hpfmn avatar Feb 22 '22 15:02 hpfmn

no, this is something else. I noticed with cardinal, I cannot slow down the repaints on macOS.

falkTX avatar Feb 22 '22 15:02 falkTX

What would you recommend to do about it?

dont call repaint on macOS for now, is the quick workaround.

falkTX avatar Feb 22 '22 15:02 falkTX

I mean dont call repaint during the drawing function.

falkTX avatar Feb 22 '22 15:02 falkTX

Hmm... okay but do you think it is a good idea to also open an issue at pugl?

hpfmn avatar Feb 22 '22 15:02 hpfmn

Hmm... okay but do you think it is a good idea to also open an issue at pugl?

I will do that eventually, will try to make a fix for it first.

falkTX avatar Feb 22 '22 15:02 falkTX

can you try with latest develop branch? lots of commits since this issue was first opened, and there were some crucial macOS related fixes.

falkTX avatar Jul 11 '22 22:07 falkTX