Skip to content

renderer: pump events until the window is exposed on creation - #1818

Open
ranawaqas-ai wants to merge 1 commit into
SFTtech:masterfrom
ranawaqas-ai:fix/macos-window-expose
Open

ranawaqas-ai wants to merge 1 commit into
SFTtech:masterfrom
ranawaqas-ai:fix/macos-window-expose

Conversation

@ranawaqas-ai

Copy link
Copy Markdown

On macOS the window never receives its first expose event, because nothing runs the event loop between setVisible(true) and the first rendered frame. Qt then refuses every buffer flush with Window exposed size does not match geometry (yet). Skipping flush to avoid visual artifacts., logged over 300,000 times in seven seconds, so the window never gets content and stays 0x0 and invisible.

Reproduced on macOS 27 (arm64) with Qt 6.11.2 on every renderer demo. A plain QML window displays correctly on the same machine, so the problem is specific to this window setup rather than Qt on macOS.

Pumping events until isExposed() returns true fixes it. Verified with renderer_demo 0 and renderer_demo 3, both of which now open a visible 800x600 window.

The copying.md authors entry is included in #the shader PR from the same branch series.

make checkmerge passes.

macOS never delivers the first expose event unless the event loop runs
before the first frame is drawn. Qt then refuses every buffer flush with
"exposed size does not match geometry", so the window never receives
content and stays 0x0 and invisible.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@TheJJ TheJJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks. while this also seems a weird workaround i think we can take it in for now.
i plan on switching to using a real qt window and then rendering inside it - our other way round has really caused too many problems.

@TheJJ

TheJJ commented Sep 23, 2026

Copy link
Copy Markdown
Member

could you make the ci pass here as well, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants