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 wayland specific code to examples for windows to appear #780

Closed

Conversation

trimental
Copy link
Contributor

  • Tested on all platforms changed

Adds wayland specific code to the examples to allow for the windows to appear.

Once a version of SCTK with Smithay/client-toolkit@74316f4 is released the git dependency can be replaced to that.

Fixes #776

@trimental
Copy link
Contributor Author

Noted that no pixels are drawn to the screen so there can be the effect of a transparent window. I didn't include drawing due to extra code overhead but that can easily be added if required.

@elinorbgr
Copy link
Contributor

elinorbgr commented Jan 27, 2019 via email

@trimental
Copy link
Contributor Author

Yes that sounds like a better implementation. I still haven't included the drawing though as that would mean handling the resize event on each example to redraw the window.

@@ -63,7 +63,7 @@ features = [

[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies]
wayland-client = { version = "0.21", features = [ "dlopen", "egl", "cursor"] }
smithay-client-toolkit = "0.4.3"
smithay-client-toolkit = { git = "https://github.com/smithay/client-toolkit" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the smithay-client-toolkit dependency changed to refer to the git version instead of the crates.io version? I'm pretty sure will prevent us from pushing this update to crates.io.

Copy link
Contributor

Choose a reason for hiding this comment

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

This requires changes from SCTK that are not yet released, though given how things are coming, next version of SCTK will be a breaking change (upgrade to wayland-client 0.22).

I plan to make the upgrade as part of the event loop 2.0 refactor, so I'd say this PR should wait until the eventloop 2.0 story is done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh wait, that was... written in original PR comment. Whoops. I guess I should read everything before making these sorts of comments 😅.

use winit::os::unix::WindowExt;

// Wayland requires the commiting of a surface to display a window
pub fn init_wayland(window: &winit::Window) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is emitting unused_variables warnings on non-linux platforms. Could you add a let _ = window; line somewhere to suppress that warning?

Copy link
Contributor

Choose a reason for hiding this comment

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

For clarity, I'd actually rather move the #[cfg(...)] in the call site in the examples, so that people can clearly see that this code is for some platform-specific stuff.

@Osspial Osspial mentioned this pull request Feb 16, 2019
@Osspial Osspial changed the base branch from master to winit-legacy June 13, 2019 05:32
@Osspial
Copy link
Contributor

Osspial commented Jun 13, 2019

Is this PR necessary, now that #835 has been merged?

@trimental
Copy link
Contributor Author

Nope 👍

@trimental trimental closed this Jun 14, 2019
@trimental trimental deleted the wayland-examples branch June 14, 2019 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants