Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
The audio player invalidates itself during idle rather than redrawing.
It was generating a paint event anyhow (at least on wxCocoa), causing a
second painting, and also this scary message to stderr on macOS:

"altrace_wx[38782:1137383] It does not make sense to draw an image when
[NSGraphicsContext currentContext] is nil.  This is a programming error.
Break on void _NSWarnForDrawingImageWithNoCurrentContext(void) to debug.
This will be logged only once.  This may break in the future."
  • Loading branch information
icculus committed Sep 15, 2019
1 parent 05fbccf commit 774bef4
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions altrace_wx.cpp
Expand Up @@ -561,16 +561,9 @@ void ALTraceAudioPlayerCtrl::onIdle(wxIdleEvent &event)
lastdrawpos = newdrawpos;
}

// !!! FIXME (at least on wxCocoa) this is generating wxPaintEvents which
// !!! FIXME: causes a second redraw. :/
if (backing) {
wxClientDC dc(this);
dc.DrawBitmap(*backing, 0, 0); // !!! FIXME: just overwrite the piece that is changing.
if (lastdrawpos < w) {
dc.SetPen(*wxYELLOW_PEN);
dc.DrawLine(lastdrawpos, 0, lastdrawpos, h);
}
}
// !!! FIXME: just overwrite the piece that is changing.
Refresh();
Update();
}

// !!! FIXME: this is a hack for now.
Expand Down

0 comments on commit 774bef4

Please sign in to comment.