-
Notifications
You must be signed in to change notification settings - Fork 61
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
Introduce CogViewport, add support in the Wayland plug-in and example program #644
Conversation
Add a new CogViewport class, which represents a container (e.g. a window, output surface, GTK widget, etc.) which can display one web view out from a group. The container can itself be observable using its "add" and "remove" signals, tracks a "visible" view, and ensures that only the visible view has the "visible" state flag enabled.
6f5523f
to
574250d
Compare
One comment after a first quick test:
|
Thanks for testing, I hadn't tried the virtual keyboard support so I didn't notice. I will try to take a look later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than the mentioned regression found with the focus. The rest of the changes looks really great.
I also notice the view->platform is not really needed and removed from the code. I am fine with this also.
I think the PR were be ready for land once you update it according my suggestion and passes the code-style checker.
Use a CogViewport instead of a single web view. This will allow the current platform plug-ins to show in their output one of many views without needing many changes. Note that in the future platform plug-ins should be updated to avoid using globals and make them handle multiple viewports (e.g. windows) as well.
Add an examples/ subdirectory, and a new simple-stack example program which shows how to attach multiple views to the CogShell view stack and switch among them.
Replace the single view saved in the CogWlPlatform by the viewport being used by the shell, taking care that only the visible view gets to update the contents of the Wayland surface and that input events get sent to the visible view as well. There are some locations where the visible view is assumed to be also the focused one, which may not be true later on when multiple viewports are supported. This compromise is okay for the time being and may need to be revisited later on.
574250d
to
5ebdb45
Compare
@psaavedra Updated, PTAL when you have a minute 🙏🏼 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. LGTM now.
This PR brings in the following:
CogViewport
class, which represents an “output” to display one of a set of view.CogShell
to use a viewport instead of a single view. At some point we will want to uncouple the shell (see Disentangle CogShell from CogPlatform #634) but this replacement is enough for now.examples/viewport.c
example program which shows how to switch between among the views of a viewport.I would recommend reviewing each commit separately.