win: Remove win::pixmap

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-03-04 00:09:05 +00:00
parent 0d7f505dd6
commit 7b664de74e
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
3 changed files with 12 additions and 16 deletions

View File

@ -2002,9 +2002,9 @@ redir_start(session_t *ps) {
for (win *w = ps->list; w; w = w->next) { for (win *w = ps->list; w; w = w->next) {
if (w->a.map_state == XCB_MAP_STATE_VIEWABLE) { if (w->a.map_state == XCB_MAP_STATE_VIEWABLE) {
w->pixmap = xcb_generate_id(ps->c); auto pixmap = xcb_generate_id(ps->c);
xcb_composite_name_window_pixmap(ps->c, w->id, w->pixmap); xcb_composite_name_window_pixmap(ps->c, w->id, pixmap);
w->win_image = ps->backend_data->ops->bind_pixmap(ps->backend_data, w->pixmap, w->win_image = ps->backend_data->ops->bind_pixmap(ps->backend_data, pixmap,
x_get_visual_info(ps->c, w->a.visual), true); x_get_visual_info(ps->c, w->a.visual), true);
if (w->shadow) { if (w->shadow) {
w->shadow_image = w->shadow_image =
@ -2077,10 +2077,8 @@ redir_stop(session_t *ps) {
if (w->shadow_image) { if (w->shadow_image) {
ps->backend_data->ops->release_image(ps->backend_data, w->shadow_image); ps->backend_data->ops->release_image(ps->backend_data, w->shadow_image);
} }
xcb_free_pixmap(ps->c, w->pixmap);
w->win_image = NULL; w->win_image = NULL;
w->shadow_image = NULL; w->shadow_image = NULL;
w->pixmap = XCB_NONE;
} else { } else {
assert(!w->win_image); assert(!w->win_image);
assert(!w->shadow_image); assert(!w->shadow_image);

View File

@ -625,9 +625,9 @@ void win_on_win_size_change(session_t *ps, win *w) {
if (w->shadow_image) { if (w->shadow_image) {
ps->backend_data->ops->release_image(ps->backend_data, w->shadow_image); ps->backend_data->ops->release_image(ps->backend_data, w->shadow_image);
} }
w->pixmap = xcb_generate_id(ps->c); auto pixmap = xcb_generate_id(ps->c);
xcb_composite_name_window_pixmap(ps->c, w->id, w->pixmap); xcb_composite_name_window_pixmap(ps->c, w->id, pixmap);
w->win_image = ps->backend_data->ops->bind_pixmap(ps->backend_data, w->pixmap, x_get_visual_info(ps->c, w->a.visual), true); w->win_image = ps->backend_data->ops->bind_pixmap(ps->backend_data, pixmap, x_get_visual_info(ps->c, w->a.visual), true);
if (w->shadow) { if (w->shadow) {
w->shadow_image = ps->backend_data->ops->render_shadow(ps->backend_data, w->widthb, w->shadow_image = ps->backend_data->ops->render_shadow(ps->backend_data, w->widthb,
w->heightb, ps->gaussian_map, w->heightb, ps->gaussian_map,
@ -1263,9 +1263,9 @@ void win_update_bounding_shape(session_t *ps, win *w) {
if (w->shadow_image) { if (w->shadow_image) {
ps->backend_data->ops->release_image(ps->backend_data, w->shadow_image); ps->backend_data->ops->release_image(ps->backend_data, w->shadow_image);
} }
w->pixmap = xcb_generate_id(ps->c); auto pixmap = xcb_generate_id(ps->c);
xcb_composite_name_window_pixmap(ps->c, w->id, w->pixmap); xcb_composite_name_window_pixmap(ps->c, w->id, pixmap);
w->win_image = ps->backend_data->ops->bind_pixmap(ps->backend_data, w->pixmap, x_get_visual_info(ps->c, w->a.visual), true); w->win_image = ps->backend_data->ops->bind_pixmap(ps->backend_data, pixmap, x_get_visual_info(ps->c, w->a.visual), true);
if (w->shadow) { if (w->shadow) {
w->shadow_image = ps->backend_data->ops->render_shadow(ps->backend_data, w->widthb, w->shadow_image = ps->backend_data->ops->render_shadow(ps->backend_data, w->widthb,
w->heightb, ps->gaussian_map, w->heightb, ps->gaussian_map,
@ -1653,9 +1653,9 @@ void map_win(session_t *ps, win *w) {
// TODO win_update_bounding_shape below will immediately // TODO win_update_bounding_shape below will immediately
// reinit w->win_data, not very efficient // reinit w->win_data, not very efficient
if (ps->redirected && ps->o.experimental_backends) { if (ps->redirected && ps->o.experimental_backends) {
w->pixmap = xcb_generate_id(ps->c); auto pixmap = xcb_generate_id(ps->c);
xcb_composite_name_window_pixmap(ps->c, w->id, w->pixmap); xcb_composite_name_window_pixmap(ps->c, w->id, pixmap);
w->win_image = ps->backend_data->ops->bind_pixmap(ps->backend_data, w->pixmap, x_get_visual_info(ps->c, w->a.visual), true); w->win_image = ps->backend_data->ops->bind_pixmap(ps->backend_data, pixmap, x_get_visual_info(ps->c, w->a.visual), true);
if (w->shadow) { if (w->shadow) {
w->shadow_image = w->shadow_image =
ps->backend_data->ops->render_shadow(ps->backend_data, w->widthb, ps->backend_data->ops->render_shadow(ps->backend_data, w->widthb,

View File

@ -128,8 +128,6 @@ struct win {
// TODO rethink reg_ignore // TODO rethink reg_ignore
// Core members // Core members
/// Named pixmap attached to this window
xcb_pixmap_t pixmap;
/// ID of the top-level frame window. /// ID of the top-level frame window.
xcb_window_t id; xcb_window_t id;
/// The "mapped state" of this window, doesn't necessary /// The "mapped state" of this window, doesn't necessary