On Tuesday, 29 November 2022 at 07:46:11 UTC Arnis wrote:
I have this problem on Mac OS 12 and 13 where my drawing functions are very "sluggish". For example dragging feels very rough. For some time I though that I just wrote the thing in a very inefficient way and tried to optimize it but without success. The code simply listens on drag events and calls window to redraw. And in the draw function there is just fl_rect function call.
So... I don't have an answer for this, but some observations (that probably are not relevant!)
A while back I had a similar-sounding issue on macOS (well, it was OSX then!) but in my case the drawing was GL based. On the main monitor the GL context was sync-locked to the monitor and so only redrew each frame at 60Hz. And it was trying to draw *a lot* of frames (way too many...)
On the external monitor the GL context wasn't sync-locked, so it was running free, and could redraw all the same frames in the blink of an eye.
Which sounds like a similar problem - but may be entirely unrelated!
On a related note, triggering a lot of redraws from within the handle method is unlikely to be "efficient" anyway, I suspect. But, as Matt says we might need to see a worked example of what you are actually doing here, to better illuminate the issues.