mouse: factorize xcb_aux_sync calls
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
3b785d6f6c
commit
6bbbf03c95
20
mouse.c
20
mouse.c
|
@ -251,6 +251,7 @@ mouse_infobox_draw(draw_context_t *ctx,
|
||||||
geometry.x + ((2 * border + geometry.width) - sw->geometry.width) / 2,
|
geometry.x + ((2 * border + geometry.width) - sw->geometry.width) / 2,
|
||||||
geometry.y + ((2 * border + geometry.height) - sw->geometry.height) / 2);
|
geometry.y + ((2 * border + geometry.height) - sw->geometry.height) / 2);
|
||||||
simplewindow_refresh_pixmap(sw);
|
simplewindow_refresh_pixmap(sw);
|
||||||
|
xcb_aux_sync(ctx->connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MOUSE_INFOBOX_STRING_DEFAULT "0000x0000+0000+0000"
|
#define MOUSE_INFOBOX_STRING_DEFAULT "0000x0000+0000+0000"
|
||||||
|
@ -479,10 +480,7 @@ mouse_client_move(client_t *c, int snap, bool infobox)
|
||||||
c->ismax = false;
|
c->ismax = false;
|
||||||
|
|
||||||
if(infobox && (c->isfloating || layout == layout_floating))
|
if(infobox && (c->isfloating || layout == layout_floating))
|
||||||
{
|
|
||||||
sw = mouse_infobox_new(c->phys_screen, c->border, c->geometry, &ctx);
|
sw = mouse_infobox_new(c->phys_screen, c->border, c->geometry, &ctx);
|
||||||
xcb_aux_sync(globalconf.connection);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* for each motion event */
|
/* for each motion event */
|
||||||
while(mouse_track_mouse_drag(&mouse_x, &mouse_y))
|
while(mouse_track_mouse_drag(&mouse_x, &mouse_y))
|
||||||
|
@ -503,10 +501,7 @@ mouse_client_move(client_t *c, int snap, bool infobox)
|
||||||
|
|
||||||
/* draw the infobox */
|
/* draw the infobox */
|
||||||
if(sw)
|
if(sw)
|
||||||
{
|
|
||||||
mouse_infobox_draw(ctx, sw, c->geometry, c->border);
|
mouse_infobox_draw(ctx, sw, c->geometry, c->border);
|
||||||
xcb_aux_sync(globalconf.connection);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* keep track */
|
/* keep track */
|
||||||
last_x = mouse_x;
|
last_x = mouse_x;
|
||||||
|
@ -614,10 +609,7 @@ mouse_client_resize_floating(client_t *c, corner_t corner, bool infobox)
|
||||||
|
|
||||||
/* create the infobox */
|
/* create the infobox */
|
||||||
if(infobox)
|
if(infobox)
|
||||||
{
|
|
||||||
sw = mouse_infobox_new(c->phys_screen, c->border, c->geometry, &ctx);
|
sw = mouse_infobox_new(c->phys_screen, c->border, c->geometry, &ctx);
|
||||||
xcb_aux_sync(globalconf.connection);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* for each motion event */
|
/* for each motion event */
|
||||||
while(mouse_track_mouse_drag(&mouse_x, &mouse_y))
|
while(mouse_track_mouse_drag(&mouse_x, &mouse_y))
|
||||||
|
@ -692,8 +684,6 @@ mouse_client_resize_floating(client_t *c, corner_t corner, bool infobox)
|
||||||
/* draw the infobox */
|
/* draw the infobox */
|
||||||
if(sw)
|
if(sw)
|
||||||
mouse_infobox_draw(ctx, sw, c->geometry, c->border);
|
mouse_infobox_draw(ctx, sw, c->geometry, c->border);
|
||||||
|
|
||||||
xcb_aux_sync(globalconf.connection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* relase pointer */
|
/* relase pointer */
|
||||||
|
@ -794,14 +784,11 @@ mouse_client_resize_tiled(client_t *c)
|
||||||
tag->mwfact = mwfact;
|
tag->mwfact = mwfact;
|
||||||
globalconf.screens[tag->screen].need_arrange = true;
|
globalconf.screens[tag->screen].need_arrange = true;
|
||||||
layout_refresh();
|
layout_refresh();
|
||||||
xcb_aux_sync(globalconf.connection);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* relase pointer */
|
/* relase pointer */
|
||||||
mouse_ungrab_pointer();
|
mouse_ungrab_pointer();
|
||||||
|
|
||||||
xcb_aux_sync(globalconf.connection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Resize the master client in mangifier layout
|
/** Resize the master client in mangifier layout
|
||||||
|
@ -876,8 +863,6 @@ mouse_client_resize_magnified(client_t *c, bool infobox)
|
||||||
if(infobox)
|
if(infobox)
|
||||||
sw = mouse_infobox_new(c->phys_screen, c->border, c->geometry, &ctx);
|
sw = mouse_infobox_new(c->phys_screen, c->border, c->geometry, &ctx);
|
||||||
|
|
||||||
xcb_aux_sync(globalconf.connection);
|
|
||||||
|
|
||||||
/* for each motion event */
|
/* for each motion event */
|
||||||
while(mouse_track_mouse_drag(&mouse_x, &mouse_y))
|
while(mouse_track_mouse_drag(&mouse_x, &mouse_y))
|
||||||
{
|
{
|
||||||
|
@ -905,10 +890,7 @@ mouse_client_resize_magnified(client_t *c, bool infobox)
|
||||||
|
|
||||||
/* draw the infobox */
|
/* draw the infobox */
|
||||||
if(sw)
|
if(sw)
|
||||||
{
|
|
||||||
mouse_infobox_draw(ctx, sw, c->geometry, c->border);
|
mouse_infobox_draw(ctx, sw, c->geometry, c->border);
|
||||||
xcb_aux_sync(globalconf.connection);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ungrab pointer */
|
/* ungrab pointer */
|
||||||
|
|
Loading…
Reference in New Issue