-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow simultaneous X11 and Wayland support #3152
Conversation
XWayland "detection" fails for mame for example so it definitely needs to be improved. Suggestions are welcome. |
Actually I was thinking about this, and maybe would be worth adding type of handle inside PlatformData. To specify which handle is passed. |
I think this would be ideal. Anything else is going to be a workaround to some extent. Do you have something like my original attempt in #3143 in mind? |
Not original because you were adding new field for specific type of window handle. What I'm thinking just one enum to identify pointer type. Since all platforms have one type it would be default (on Linux default would mean X11) and if you passing Wayland handle on Linux you would specify with enum. struct NativeWindowHandleType
{
enum Enum
{
Default = 0,
Wayland,
Count
};
}; |
Something like this? If so, I will add the code to other examples. |
41b9fae
to
29bfef6
Compare
I have added the code to the remaining entries and the remaining examples. |
Submit another PR where you use
|
I just tried but this results in SIGILL:
|
BX_UNUSED is just for handle, you don't need to change anything else... |
bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle)
{
BX_UNUSED(_handle); <--- prevents warnings about unused argument...
return bgfx::NativeWindowHandleType::Default;
} |
See: cbfea75 |
* Allow simultaneous X11 and Wayland support * Add NativeWindowHandleType * Set default value for g_platformData.type * Use g_platformData.type to check for a native Wayland window * Stub getNativeWindowHandleType on platform where Wayland is not an option * Implement getNativeWindowHandleType for GLFW * Add getNativeWindowHandleType to the remaining C++ examples * Add getNativeWindowHandleType to the C example
* Allow simultaneous X11 and Wayland support * Add NativeWindowHandleType * Set default value for g_platformData.type * Use g_platformData.type to check for a native Wayland window * Stub getNativeWindowHandleType on platform where Wayland is not an option * Implement getNativeWindowHandleType for GLFW * Add getNativeWindowHandleType to the remaining C++ examples * Add getNativeWindowHandleType to the C example
XWayland detection is a hack currently. Feedback is welcome how to do this in a less ugly way