Skip to content
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

Add Connection::create_native_widget_from_rwh() #61

Closed
wants to merge 4 commits into from

Conversation

zicklag
Copy link

@zicklag zicklag commented Mar 2, 2020

Adds a function for creating a native widget from a raw window handle.

Not tested yet.

Fixes #60.

Adds a function for creating a native widget from a raw window handle.
Added missing create_native_widget_from_rwh implementations, even if for
now they just return "unsupported" errors.
@kvark
Copy link

kvark commented Mar 28, 2020

Surfman doesn't support iOS platform?

@kvark
Copy link

kvark commented Mar 28, 2020

Added macOS and Android in a sub-pr katharostech#1

@zicklag
Copy link
Author

zicklag commented Mar 28, 2020

Sweet, merged. :)

@zicklag
Copy link
Author

zicklag commented Mar 28, 2020

@pcwalton So as far as the wayland implementation goes, I wasn't sure how to get the size of the wayland surface from the raw window handle, but according to this gfx-rs/gfx#3151 (comment) there isn't really a real size to get.

I'm not sure if that will work fine then with an arbitrary size set at widget creation? Would the surface/widget need to be resized at swapchain creation time, or do we not need to worry about it? I don't know how to test Wayland so I haven't tested it.

@zicklag zicklag marked this pull request as ready for review March 28, 2020 13:54
@zicklag
Copy link
Author

zicklag commented Mar 29, 2020

FYI I just added an extra commit in here that fixes builds on Linux that are made without the sm-x11 feature.

I could split it to a separate PR if desired.

@zicklag
Copy link
Author

zicklag commented Apr 5, 2020

Oops, that last commit was broken BTW, don't merge yet!

Edit: Actually, it wasn't broken. I was confused, but still don't merge this yet.

kvark and others added 2 commits April 5, 2020 19:09
Building on Linux without the `sm-x11` feature was failing. This commit
makes sure that surfman doesn't attempt to use x11 when it is not
compiled with the `sm-x11` feature.
@zicklag zicklag force-pushed the native-widget-from-rwh branch from 008bb16 to ad951ef Compare April 6, 2020 00:09
@zicklag
Copy link
Author

zicklag commented Apr 9, 2020

Closing in favor of servo#172.

@zicklag zicklag closed this Apr 9, 2020
bors-servo added a commit to servo/surfman that referenced this pull request Apr 12, 2020
GFX Support Features

This PR contains additions to `surfman` needed for supporting the `gfx-backend-gl` effort that is being worked on in gfx-rs/gfx#3151. Still a work in progress at the moment, but it is almost finished I think.

This supercedes: pcwalton#61.

The PR adds new functions for creating a native widget from a raw window handle and will also contain fixes to allow compiling on MacOS without having to disable unsupported features.

These are both features needed by `gfx-backend-gl`.
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.

Provide a Way to Create a NativeWidget From a Raw Window Handle
2 participants