Skip to content

glutin: Rewrite using Glutin 0.30 to provide Compositor#1688

Closed
ids1024 wants to merge 3 commits intoiced-rs:masterfrom
ids1024:glutin-compositor
Closed

glutin: Rewrite using Glutin 0.30 to provide Compositor#1688
ids1024 wants to merge 3 commits intoiced-rs:masterfrom
ids1024:glutin-compositor

Conversation

@ids1024
Copy link
Copy Markdown
Contributor

@ids1024 ids1024 commented Jan 31, 2023

This provides a Compositor adapting a GLCompositor, that thus can be used with iced_winit or with a different shell.

Seems to be working for me on Wayland, but it needs more testing. And there are a few remaining questions:

  • How should it handle the case where compatible_window is None? Is it reasonable to return an error in that case? Should the trait not take an Option here?
  • Is using the same config and context for all windows reasonable? I guess different windows may have different requirements in some cases on some platforms?
  • It probably should do something fancier than selecting the first config returned by find_configs.
  • Should the create_surface method of the trait return a Result?

@ids1024
Copy link
Copy Markdown
Contributor Author

ids1024 commented Feb 1, 2023

The CI failure is in integration_opengl. #1689 has some initial changes to make that not depend on Glutin 0.29.

@ids1024 ids1024 changed the title sctk_glutin: Rewrite using Glutin 0.30 to provide Compositor glutin: Rewrite using Glutin 0.30 to provide Compositor Feb 1, 2023
Glutin 0.30 changes the API to not depend on winit, and instead take a
raw window handle. `glutin-winit` is a helper to make it a bit easier to
create a GL context on top of winit.

Things like `iced_winit::conversion::window_event` are problematic here
since we end up using a different winit version from `iced_winit`, and
that function is quite complicated to duplicate. But we don't need all
of it.

Duplicating isn't so unreasonable. It's probably expected that
integrations of Iced could not rely on conversions from `iced_winit`,
since likely use something other than winit to get a window and OpenGL
context, and in any case are not using the Iced fork of `winit`.
@ids1024
Copy link
Copy Markdown
Contributor Author

ids1024 commented Feb 1, 2023

If #1689 is merged that will fix the build failure. Still leaving the questions above.

ids1024 added a commit to pop-os/iced that referenced this pull request Feb 2, 2023
This provides a `Compositor` adapting a `GLCompositor`, that thus can be
used with `iced_winit` or with a different shell.

Backport of iced-rs#1688. Still needs some
work.
ids1024 added a commit to pop-os/iced that referenced this pull request Feb 7, 2023
This provides a `Compositor` adapting a `GLCompositor`, that thus can be
used with `iced_winit` or with a different shell.

Backport of iced-rs#1688. Still needs some
work.
@ids1024
Copy link
Copy Markdown
Contributor Author

ids1024 commented Feb 8, 2023

Perhaps Compositor could also benefit from a way to control vsync behavior. On Wayland, present may block indefinitely on vsync for an occluded window, since the compositor does not send frame callbacks for windows that are not visible.

Not sure if that's an issue with Iced currently, but it would impact multi-window and may be a problem for some integrations of Iced.

May be necessary in implementations other than Wgpu.
This provides a `Compositor` adapting a `GLCompositor`, that thus can be
used with `iced_winit` or with a different shell.
@hecrj
Copy link
Copy Markdown
Member

hecrj commented Apr 12, 2023

We are deprecating removing iced_glutin and iced_glow in the upcoming advanced-text branch.

I still think there is a need for iced_glutin and iced_glow, but we are not comitting to maintaining them officially anymore.

If you or anyone would want to take over these crates, I'd be more than happy to provide you with repositories in the organization!

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