Skip to content

Adding graphics support for MacOS using XQuartz#317

Closed
natestone wants to merge 3 commits intoProjectPhysX:masterfrom
natestone:master
Closed

Adding graphics support for MacOS using XQuartz#317
natestone wants to merge 3 commits intoProjectPhysX:masterfrom
natestone:master

Conversation

@natestone
Copy link
Copy Markdown

Adds a fallback mode to determine available screen/X11 options when xrandr fails to produce the desired result. Since XQuartz has an incomplete xrandr implementation, the default graphics requests fail. The fallback uses other X11 calls to determine the screen width and height to create a full screen implementation for the INTERACTIVE_GRAPHICS option.

XQuartz on Mac does not have a fully-compliant RandR system. This
modification allows the X11 provisioning to fall back to the screen
size of the display using window dimensions.  This will probably
increase compatibility with other systems that have incomplete
X11 implementations.
@natestone natestone mentioned this pull request Nov 10, 2025
@ProjectPhysX
Copy link
Copy Markdown
Owner

Hi @natestone,

thanks a lot for testing and for this suggestion! I've added your changes in this commit.

Kind regards,
Moritz

Comment thread src/graphics.cpp
XRRFreeScreenResources(x11_screen_resources);
if(x11_screen_resources) {
RROutput primary_output = XRRGetOutputPrimary(x11_display, x11_root_window);
XRROutputInfo* x11_output_info = (primary_output != None) ? XRRGetOutputInfo(x11_display, x11_screen_resources, primary_output) : nullptr;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@ProjectPhysX XRRGetOutputInfo causes a hard crash on XQuartz, so it should only be conditionally called if XRRGetOutputPrimary returns a valid value (e.g. as done in line 702).

e34f29d still crashes on macOS.

Kind regards,
Paul

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for testing! Fixed!

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.

3 participants