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

core: isolate X connection with error handling into a struct #1087

Merged
merged 2 commits into from
Jul 4, 2023

Conversation

yshui
Copy link
Owner

@yshui yshui commented Jun 29, 2023

Part of the long running effort to reduce the prevalence of session_t. After this, functions that communicate with X can make use of the error handling machinary (set_ignore_cookie, set_cant_fail_cookie) without needing to take a session_t parameter.

This commit converts everything to use the new struct x_connection, most of the conversions are mechanical.

@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #1087 (6bd780f) into next (4e6dddc) will decrease coverage by 0.12%.
The diff coverage is 41.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #1087      +/-   ##
==========================================
- Coverage   37.67%   37.56%   -0.12%     
==========================================
  Files          49       49              
  Lines       11168    11190      +22     
==========================================
- Hits         4208     4203       -5     
- Misses       6960     6987      +27     
Impacted Files Coverage Δ
src/backend/backend.c 60.91% <0.00%> (ø)
src/backend/xrender/xrender.c 0.00% <0.00%> (ø)
src/common.h 75.00% <0.00%> (+0.80%) ⬆️
src/dbus.c 21.65% <0.00%> (ø)
src/opengl.c 0.00% <0.00%> (ø)
src/vsync.c 0.00% <0.00%> (ø)
src/win.h 78.12% <ø> (ø)
src/render.c 0.57% <1.44%> (-0.74%) ⬇️
src/backend/gl/egl.c 24.35% <33.33%> (ø)
src/backend/gl/glx.c 38.51% <34.14%> (-0.23%) ⬇️
... and 8 more

Copy link
Collaborator

@absolutelynothelix absolutelynothelix left a comment

Choose a reason for hiding this comment

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

there are a lot of unrelated style and formatting changes. they should either be pushed directly and the pull request should be based on them or be a separate commit(s) because they make the actual reviewing harder and slower. the same applies to the unrelated logic changes. all of these changes are good but they should be separated to make reviewing easy. to prevent this in the future i suggest you to at least run clang-format on all .c and .h files and do a direct push.

overall, lgtm.

btw, a reminder. this todo seems to be related to these changes:

picom/src/x.c

Line 491 in d4f7282

// TODO(yshui) separate error code out from session_t

src/render.c Outdated Show resolved Hide resolved
src/render.c Outdated Show resolved Hide resolved
src/x.h Outdated Show resolved Hide resolved
src/x.h Outdated Show resolved Hide resolved
src/x.h Outdated Show resolved Hide resolved
src/x.h Show resolved Hide resolved
src/x.c Outdated Show resolved Hide resolved
src/x.c Outdated Show resolved Hide resolved
src/x.c Outdated Show resolved Hide resolved
@yshui
Copy link
Owner Author

yshui commented Jul 4, 2023

@absolutelynothelix I've fixed all your points. thanks for the review btw.

btw, a reminder. this todo seems to be related to these changes:

I think this comment is referring to the ps->*_error error codes.

yshui added 2 commits July 4, 2023 16:24
Part of the long running effort to reduce the prevalence of `session_t`.
After this, functions that communicate with X can make use of the error
handling machinary (set_ignore_cookie, set_cant_fail_cookie) without
needing to take a `session_t` parameter.

This commit converts everything to use the new struct `x_connection`,
most of the conversions are mechanical.

Signed-off-by: Yuxuan Shui <[email protected]>
@absolutelynothelix
Copy link
Collaborator

I think this comment is referring to the ps->*_error error codes.

yeah, i think you wanted to separate the *_error (*_event and has_* too, probably) members from the session_t structure. i just found this todo relevant to the current changes and decided to remind you about it so you may take it if you find it relevant too.

@absolutelynothelix absolutelynothelix merged commit a5f0ac3 into next Jul 4, 2023
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