-
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
Several code cleanups and refactorings #618
Conversation
@psaavedra This needs a rebase now that #617 has already been landed, could you please update it? Thanks! |
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.
Needs rebasing.
8efed09
to
72cba1c
Compare
Yes, sorry for that. Done. |
72cba1c
to
22050b1
Compare
22050b1
to
de7969a
Compare
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.
I have a couple of small nits, otherwise the patch LGTM and we could merge it when the small comments are addressed. Thanks for the cleanup!
platform/wayland/cog-platform-wl.h
Outdated
#ifndef COG_PLATFORM_WL_PLATFORM_H | ||
#define COG_PLATFORM_WL_PLATFORM_H |
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.
We prefer #pragma once
these days:
#ifndef COG_PLATFORM_WL_PLATFORM_H | |
#define COG_PLATFORM_WL_PLATFORM_H | |
#pragma once |
Then you won't need the #endif
below either.
platform/wayland/cog-platform-wl.h
Outdated
|
||
#endif /* !COG_PLATFORM_WL_PLATFORM_H */ |
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.
No need for this #endif
when using #pragma once
, and the G_END_DECLS
needs to go here:
#endif /* !COG_PLATFORM_WL_PLATFORM_H */ | |
G_END_DECLS |
platform/wayland/cog-platform-wl.h
Outdated
G_BEGIN_DECLS | ||
|
||
G_DECLARE_FINAL_TYPE(CogWlPlatform, cog_wl_platform, COG, WL_PLATFORM, CogPlatform) | ||
G_END_DECLS |
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.
Function and struct
declarations also need to be inside G_{BEGIN,END}_DECLS
, this needs to be moved to the end of the file.
G_END_DECLS |
struct _CogWlSeat { | ||
struct wl_seat *seat; | ||
uint32_t seat_name; | ||
uint32_t seat_version; |
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.
Funny thing: I just realized that seat_version
is not used anywhere. Let's leave it be for now, but we could make a follow-up patch later on to remove it 😉
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.
I am preparing another change for supporting multiple seats. I will keep this in mind.
The CogWlDisplay is defined in cog-utils-wl.h. Also wl_data and egl_data definition are renamed as s_display.
All the related resources to an individual wl_seat are encapsulated into a CogWlSeat struct. The CogWlDisplay contains a CogWlSeat (the first registered). This change is motivated towards the progress of being able to have more than one view.
de7969a
to
9781b90
Compare
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.
This is now ready for landing 🛬
These changes are motivated towards the progress of being able to have more than one view: