-
Notifications
You must be signed in to change notification settings - Fork 768
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
Fix colormap handling for containers. #2450
Conversation
I think we also need to dump this property so we can restore it after an in-place restart. Otherwise we leave garbage in the server. |
Actually I can't quite explain why, but not doing so seems to be correct. At least when I attempt to dump & parse it, I get pretty bad glitching. Perhaps colormaps are freed by the server if the client disconnects? Either way, everything seems to be OK. |
if (con->depth != root_depth) { | ||
/* We need to create a custom colormap. */ | ||
win_colormap = xcb_generate_id(conn); | ||
xcb_create_colormap_checked(conn, XCB_COLORMAP_ALLOC_NONE, win_colormap, root, visual); |
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.
@Airblader made me look at this diff and now I am again complaining about an unrelated issue:
This line has a memory leak. When using a _checked
request you should eventually pass the resulting xcb_void_cookie_t*
to xcb_request_check
to know about the result of the operation. If you don't care about it, then don't use the _checked
variant. (Or call xcb_discard_reply
on the cookie, but that would be quite pointless)
Edit: Ok, sorry, I was (partly) wrong. This does not actually cause a memory leak (only if the CreateColormap request fails which should never happen), but it's still weird.
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.
Yeah, it definitely is unnecessary. I'll change it, thanks. :-) And as always thanks for reviewing (and answering my questions.)
This commit correctly handles colormaps by * Using the static default colormap we determine on startup if the con has the corresponding depth. This avoids creating pointless colormaps. * Not freeing the default colormap to not have stray colormaps on containers. This fixes an issue with certain programs such as xwd. * Creating a custom colormap when necessary and freeing it when the container is killed. fixes i3#2435
@stapelberg OK, should be good to go now. |
Thanks psychon for pointing this out in #2450 (comment)!
This commit correctly handles colormaps by
con has the corresponding depth. This avoids creating pointless
colormaps.
containers. This fixes an issue with certain programs such as xwd.
container is killed.
fixes #2435