forked from soreau/weston
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Libweston v2 #1
Open
giucam
wants to merge
12
commits into
master
Choose a base branch
from
libweston-v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Libweston v2 #1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
504022e
to
d6c5d1e
Compare
9fc8c2a
to
d060942
Compare
This is a preliminary change for libweston, with no functional modifications. Separate the backends and the core weston_compositor struct, by creating the weston_compositor in the main(), and having the various backends extend the weston_backend struct, an instance of which is returned by the backend entry point. This enable us to logically separate the compositor core from the backend, allowing the core to be extended without messing with the backends.
This commit adds three new exported functions: - weston_compositor_create() returns a new weston_compositor instance, initializing it as the now removed weston_compositor_init() did. - weston_compositor_exit(compositor) asks the compositor to tear down by calling the compositor's exit vfunc which is set by the libweston application. - weston_compositor_destroy(compositor) is called by the libweston application when tearing down the compositor. The compositor is destroyed and the memory freed.
This commits starts to separate the libweston code from the weston specific code. As such, the main() is moved, together with signals handling and configuration handling.
The backends used to have lots of code dealing with weston specific configs. To allow them to be used by other compositors with their own configurations remove all the usage of weston_config from the backends code and move it in weston.c. The backends are now initialized with the new weston_compositor_init_backend() function which takes a pointer to a weston_backend_config struct. Each backend now installs one header where a subclass of weston_backend_config is defined, and the compositor creates an instance of the backend-specific config struct and passes it to weston_compositor_init_backend(). This means that the compositor now needs to know about all the backends to be able to instantiate them, but no backend specific API such as xcb or libdrm leaks through, so there are no new dependencies for the compositor. A backend may now set a vfunc pointer to create a new compositor. Not all do though, and use instead a callback function to configure a new output that comes from below the compositor, instead of above it.
Instead of the central weston_config pointer we now store it in some module-specific pointers. This way we can remove them one by one.
The library is versioned, so a -N is appended to its name, e.g. libweston-1.so. The same is done for the pc file, the include and lib/weston dirs. This allows multiple libweston versions to be installed together. Additionally, a new libweston.pc is introduced in paraller with weston.pc, which is used when building a Weston plugin.
libweston still used those functions internally, so it was not linkable yet by other compositors.
Move the code launching the screenshooter client and implementing the screenshot protocol out of libweston, and make screenshooter.c a generic way to hook screenshoot protocols into weston. A new header weston.h is added, with an entry point for the shells to init the screenshooter.
It uses the weston_client_launch API, which is not available in libweston.
the --enable/disable-weston-binaries enables or disables the creation of 'weston', 'weston-launch' and all the binaries that are installed in $prefix/lib/libexec. This allows, together with --enable-clients, to only build the libraries, making possible to build and install different libweston versions at the same time.
That's still pretty ancient, not even supporting xdg-shell-unstable-v6, let alone xdg-shell-stable required by an increasing amount of programs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.