Desallocate replies and events properly
This commit is contained in:
parent
216f7f16f2
commit
2f9409ba74
27
client.c
27
client.c
|
@ -932,20 +932,25 @@ uicb_client_moveresize(int screen, char *arg)
|
||||||
if(globalconf.screens[sel->screen].resize_hints)
|
if(globalconf.screens[sel->screen].resize_hints)
|
||||||
geometry = client_geometry_hints(sel, geometry);
|
geometry = client_geometry_hints(sel, geometry);
|
||||||
client_resize(sel, geometry, false);
|
client_resize(sel, geometry, false);
|
||||||
if (xqp && ox <= xqp->root_x && (ox + 2 * sel->border + ow) >= xqp->root_x &&
|
if (xqp)
|
||||||
oy <= xqp->root_y && (oy + 2 * sel->border + oh) >= xqp->root_y)
|
|
||||||
{
|
{
|
||||||
nmx = xqp->root_x - (ox + sel->border) + sel->geometry.width - ow;
|
if(ox <= xqp->root_x && (ox + 2 * sel->border + ow) >= xqp->root_x &&
|
||||||
nmy = xqp->root_y - (oy + sel->border) + sel->geometry.height - oh;
|
oy <= xqp->root_y && (oy + 2 * sel->border + oh) >= xqp->root_y)
|
||||||
|
{
|
||||||
|
nmx = xqp->root_x - (ox + sel->border) + sel->geometry.width - ow;
|
||||||
|
nmy = xqp->root_y - (oy + sel->border) + sel->geometry.height - oh;
|
||||||
|
|
||||||
if(nmx < -sel->border) /* can happen on a resize */
|
if(nmx < -sel->border) /* can happen on a resize */
|
||||||
nmx = -sel->border;
|
nmx = -sel->border;
|
||||||
if(nmy < -sel->border)
|
if(nmy < -sel->border)
|
||||||
nmy = -sel->border;
|
nmy = -sel->border;
|
||||||
|
|
||||||
xcb_warp_pointer(globalconf.connection,
|
xcb_warp_pointer(globalconf.connection,
|
||||||
XCB_NONE, sel->win,
|
XCB_NONE, sel->win,
|
||||||
0, 0, 0, 0, nmx, nmy);
|
0, 0, 0, 0, nmx, nmy);
|
||||||
|
}
|
||||||
|
|
||||||
|
p_delete(&xqp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
17
event.c
17
event.c
|
@ -403,6 +403,7 @@ event_handle_keypress(void *data __attribute__ ((unused)),
|
||||||
* number with screen_get_bycoord: we'll get 0 in Zaphod mode
|
* number with screen_get_bycoord: we'll get 0 in Zaphod mode
|
||||||
* so it's the same, or maybe the real Xinerama screen */
|
* so it's the same, or maybe the real Xinerama screen */
|
||||||
screen = screen_get_bycoord(globalconf.screens_info, screen, qpr->root_x, qpr->root_y);
|
screen = screen_get_bycoord(globalconf.screens_info, screen, qpr->root_x, qpr->root_y);
|
||||||
|
p_delete(&qpr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,6 +458,9 @@ event_handle_maprequest(void *data __attribute__ ((unused)),
|
||||||
p_delete(&wa);
|
p_delete(&wa);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p_delete(&wa);
|
||||||
|
|
||||||
if(!client_get_bywin(globalconf.clients, ev->window))
|
if(!client_get_bywin(globalconf.clients, ev->window))
|
||||||
{
|
{
|
||||||
if((wgeom = xcb_get_geometry_reply(connection,
|
if((wgeom = xcb_get_geometry_reply(connection,
|
||||||
|
@ -468,13 +472,14 @@ event_handle_maprequest(void *data __attribute__ ((unused)),
|
||||||
xcb_query_pointer(connection,
|
xcb_query_pointer(connection,
|
||||||
xcb_aux_get_screen(globalconf.connection, screen_nbr)->root),
|
xcb_aux_get_screen(globalconf.connection, screen_nbr)->root),
|
||||||
NULL)) != NULL)
|
NULL)) != NULL)
|
||||||
screen_nbr = screen_get_bycoord(globalconf.screens_info, screen_nbr, qpr->root_x, qpr->root_y);
|
{
|
||||||
else
|
screen_nbr = screen_get_bycoord(globalconf.screens_info, screen_nbr,
|
||||||
for (iter = xcb_setup_roots_iterator (xcb_get_setup (connection)), screen_nbr = 0;
|
qpr->root_x, qpr->root_y);
|
||||||
iter.rem && iter.data->root != wgeom->root; xcb_screen_next (&iter), ++screen_nbr);
|
|
||||||
|
|
||||||
if(qpr)
|
|
||||||
p_delete(&qpr);
|
p_delete(&qpr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
for(iter = xcb_setup_roots_iterator (xcb_get_setup (connection)), screen_nbr = 0;
|
||||||
|
iter.rem && iter.data->root != wgeom->root; xcb_screen_next (&iter), ++screen_nbr);
|
||||||
|
|
||||||
client_manage(ev->window, wgeom, screen_nbr);
|
client_manage(ev->window, wgeom, screen_nbr);
|
||||||
p_delete(&wgeom);
|
p_delete(&wgeom);
|
||||||
|
|
8
layout.c
8
layout.c
|
@ -83,12 +83,14 @@ arrange(int screen)
|
||||||
xcb_query_pointer_unchecked(globalconf.connection,
|
xcb_query_pointer_unchecked(globalconf.connection,
|
||||||
xcb_aux_get_screen(globalconf.connection,
|
xcb_aux_get_screen(globalconf.connection,
|
||||||
phys_screen)->root),
|
phys_screen)->root),
|
||||||
NULL)) != NULL
|
NULL)) != NULL)
|
||||||
&& (xqp->root == XCB_NONE || xqp->child == XCB_NONE || xqp->root == xqp->child))
|
|
||||||
{
|
{
|
||||||
window_root_grabbuttons(phys_screen);
|
if(xqp->root == XCB_NONE || xqp->child == XCB_NONE || xqp->root == xqp->child)
|
||||||
|
window_root_grabbuttons(phys_screen);
|
||||||
|
|
||||||
globalconf.pointer_x = xqp->root_x;
|
globalconf.pointer_x = xqp->root_x;
|
||||||
globalconf.pointer_y = xqp->root_y;
|
globalconf.pointer_y = xqp->root_y;
|
||||||
|
p_delete(&xqp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reset status */
|
/* reset status */
|
||||||
|
|
1
mouse.c
1
mouse.c
|
@ -222,7 +222,6 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
|
||||||
mouse_resizebar_draw(ctx, style, sw, c->geometry, c->border);
|
mouse_resizebar_draw(ctx, style, sw, c->geometry, c->border);
|
||||||
|
|
||||||
xcb_aux_sync(globalconf.connection);
|
xcb_aux_sync(globalconf.connection);
|
||||||
p_delete(&ev);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -141,6 +141,8 @@ placement_under_mouse(Client *c)
|
||||||
{
|
{
|
||||||
finalgeometry.x = xqp->root_x - c->f_geometry.width / 2;
|
finalgeometry.x = xqp->root_x - c->f_geometry.width / 2;
|
||||||
finalgeometry.y = xqp->root_y - c->f_geometry.height / 2;
|
finalgeometry.y = xqp->root_y - c->f_geometry.height / 2;
|
||||||
|
|
||||||
|
p_delete(&xqp);
|
||||||
}
|
}
|
||||||
|
|
||||||
finalgeometry = titlebar_geometry_add(&c->titlebar, finalgeometry);
|
finalgeometry = titlebar_geometry_add(&c->titlebar, finalgeometry);
|
||||||
|
|
Loading…
Reference in New Issue