Skip to content

api: split views and surfaces #1370

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

Merged
merged 1 commit into from
Nov 29, 2021
Merged

api: split views and surfaces #1370

merged 1 commit into from
Nov 29, 2021

Conversation

ammen99
Copy link
Member

@ammen99 ammen99 commented Nov 28, 2021

Instead of making view_interface_t a subclass of surface_interface_t, we use composition. Now each view has a main surface accessible via get_main_surface().

This allows for cleaner separation of responsibilities, and we don't have to use hacks in wlr_surface_base_t to avoid double inheritance.

Also, this is a second step to supporting the same window being visible on multiple outputs, as we use shared pointers for surfaces.
Now, we can have multiple views which use the same surfaces.
This is of course also useful for plugins which need to override the way Wayfire handles surfaces - for example, by providing a custom Xwayland view implementation, but reusing the wlr_surface handling.
Another potential example are client-rendered server side decorations, or implementations of custom shells.

Preparation for the final part of #1309, which is splitting the desktop surface part out of the view.

Instead of making view_interface_t a subclass of surface_interface_t, we
use composition. Now each view has a main surface accessible via
get_main_surface().

This allows for cleaner separation of responsibilities, and we don't
have to use hacks in wlr_surface_base_t to avoid double inheritance.

Also, this is a second step to supporting the same window being visible
on multiple outputs, as we use shared pointers for surfaces. Now, we can
have multiple views which use the same surfaces. This is of course also
useful for plugins which need to override the way Wayfire handles
surfaces - for example, by providing a custom Xwayland view
implementation, but reusing the wlr_surface handling. Another potential
example are client-rendered server side decorations, or implementations
of custom shells.

Preparation for the final part of #1309, which is splitting the desktop
surface part out of the view.
@ammen99 ammen99 merged commit 6fa7890 into stabilize-api Nov 29, 2021
@ammen99 ammen99 deleted the split-surface-view branch November 29, 2021 09:03
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.

1 participant