Hi,
I’m kind of new around here so I’m not sure whether this is the best place to report potential bugs.
StretchableLayoutResizerBar::paint() directly calls isMouseOver(). When the component is attached to an OpenGL context, paint() is called outside the main thread, and since isMouseOver() maps to a macOS UI call this triggers a warning:
Main Thread Checker: UI API called on a background thread: -[NSView frame]
Hi there,
Bumping this because I just found another component suffering from the same issue: ScrollBar::paint() calls isMouseOver() and isMouseButtonDown(). So it triggers the same UI API check warning when attached to a GL context.
Is that a second bug or am I missing something?
Wouldn’t the issue persist, what with of isMouseButtonDown() still in use in StretchableLayoutResizerBar? In other words, the storing of a isMouseDown bool treatment seems to need to be applied there - based on what you’re saying that is.
Oh, right, I see what you meant now. It turns out calling isMouseButtonDown doesn’t trigger the macOS warning, which is why I didn’t replace it in the first patch but you’re right, it would probably be a good idea.
I’ll complete the patch if there’s interest in merging it (still hoping to get feedback from official devs).
I’ve put together a solution for this issue. I think it probably makes more sense to address this directly in Component, rather than in each of the individual derived components. I’ll update this thread once the change is merged.
Under what circumstances do you see this issue with isMinimised? I wouldn’t expect components to need to check isMinimised during painting, but maybe there’s a use-case I’ve overlooked.