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

How does the wlc_view get created? #238

Closed
xeechou opened this issue Mar 2, 2017 · 4 comments
Closed

How does the wlc_view get created? #238

xeechou opened this issue Mar 2, 2017 · 4 comments

Comments

@xeechou
Copy link

xeechou commented Mar 2, 2017

Hi all, I want to know how/when does wlc generated wlc_view for a a wl_surface Because I want to write a custom interface for a background and other things. Is a wlc_view created at some where like wl_surface_attach callback? I checked the code in src/resources/types/surface.c, but it seems that wlc_view is not create there.

Can anybody help?

@Cloudef
Copy link
Owner

Cloudef commented Mar 2, 2017

wlc_view is created when role is assigned to surface. Wlc only creates views for roles it supports by default and that is xdg_surface and wl_surface. If you want custom roles you need to extend wlc, see wlc-wayland.h. You can also turn surfaces into views without roles using https://github.com/Cloudef/wlc/blob/master/include/wlc/wlc-wayland.h#L40

@xeechou
Copy link
Author

xeechou commented Mar 2, 2017

So are wl_shell_surface or xdg_surface are sufficient choices for stuff like background?

@Cloudef
Copy link
Owner

Cloudef commented Mar 2, 2017

No, those are supposed to be used by GUI programs. https://github.com/Cloudef/wlc/blob/master/tests/wl-extension.c this can give you idea how to do background.

@xeechou
Copy link
Author

xeechou commented Mar 6, 2017

okay, thanks, I tried, output_pre_render_callback is efficient, it didn't take much cpu resources as I expected, thanks

@xeechou xeechou closed this as completed Mar 6, 2017
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

No branches or pull requests

2 participants