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

Move Wayland client logic into WS::BaseBackend, WS::BaseTarget classes #65

Merged
merged 3 commits into from
Jul 29, 2019

Conversation

zdobersek
Copy link
Contributor

Move the Wayland client logic from EGL rendering backends and targets into
standalone WS::BaseBackend and WS::BaseTarget classes, leaving only the
EGL specifics inside the Backend and Target classes implementing the
EGL-oriented renderer_backend_egl and renderer_backend_egl_target interfaces.
This makes the Wayland client code possible to reuse for backends and targets
targeting other rendering APIs.

Two notable changes in behavior:
  - The wl_display object is now destroyed through wl_display_disconnect().
  - We destroy the wl_registry object as soon as it's not necessary anymore.
@zdobersek zdobersek requested a review from aperezdc July 28, 2019 11:06
Copy link
Member

@aperezdc aperezdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactor, thanks!

The comments I made are nothing that prevents merging this and I filed issues to remember about them later on.


BaseBackend::BaseBackend(int hostFD)
{
m_wl.display = wl_display_connect_to_fd(hostFD);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, now that I see this being moved it makes me think that we should add some error checking in case wl_display_connect_to_fd() and at least log the error instead of continuing silently. Anyway, this PR is just moving the code around so I wold rather have that as a cleanup later on—I just opened issue #66 to not forget about it.

void BaseTarget::requestFrame()
{
if (m_wl.frameCallback)
std::abort();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a similar vein, g_error() would be nicer as it would also print a message, but this PR is only moving code around, so let's use #68 to track doing this later on.

@aperezdc aperezdc merged commit 462c781 into master Jul 29, 2019
@zdobersek zdobersek deleted the zdobersek/ws-client branch July 29, 2019 20:08
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