Client: Add uicb function client_{move, resize} requested by YDB.
This commit is contained in:
parent
7eceb99dee
commit
fd14922e62
53
src/client.c
53
src/client.c
@ -998,3 +998,56 @@ uicb_client_screen_prev(uicb_t cmd)
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/** Move a client
|
||||
*\param cmd uicb_t type
|
||||
*/
|
||||
void
|
||||
uicb_client_move(uicb_t cmd)
|
||||
{
|
||||
XRectangle geo;
|
||||
int xi = 0, yi = 0;
|
||||
|
||||
if(!sel || sel->tile || sel->max
|
||||
|| sel->lmax || sel->state_fullscreen)
|
||||
return;
|
||||
|
||||
geo = sel->geo;
|
||||
|
||||
if(sscanf(cmd, "%d %d", &xi, &yi))
|
||||
{
|
||||
geo.x += xi;
|
||||
geo.y += yi;
|
||||
|
||||
client_moveresize(sel, geo, False);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** Resize a client
|
||||
*\param cmd uicb_t type
|
||||
*/
|
||||
void
|
||||
uicb_client_resize(uicb_t cmd)
|
||||
{
|
||||
XRectangle geo;
|
||||
int wi = 0, hi = 0;
|
||||
|
||||
if(!sel || sel->tile || sel->max
|
||||
|| sel->lmax || sel->state_fullscreen)
|
||||
return;
|
||||
|
||||
geo = sel->geo;
|
||||
|
||||
if(sscanf(cmd, "%d %d", &wi, &hi))
|
||||
{
|
||||
geo.width += wi;
|
||||
geo.height += hi;
|
||||
|
||||
client_moveresize(sel, geo, False);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -44,6 +44,8 @@ conf_init_func_list(void)
|
||||
{"client_kill", uicb_client_kill },
|
||||
{"client_prev", uicb_client_prev },
|
||||
{"client_next", uicb_client_next },
|
||||
{"client_move", uicb_client_move },
|
||||
{"client_resize", uicb_client_resize },
|
||||
{"client_swap_next", uicb_client_swap_next },
|
||||
{"client_swap_prev", uicb_client_swap_prev },
|
||||
{"client_screen_next", uicb_client_screen_next },
|
||||
@ -422,7 +424,7 @@ conf_menu_section(cfg_t *cfg_m)
|
||||
|
||||
conf.nmenu = cfg_size(cfg_m, "set_menu");
|
||||
CHECK(conf.nmenu);
|
||||
conf.menu = calloc(conf.nmenu, sizeof(Menu));
|
||||
conf.menu = emalloc(conf.nmenu, sizeof(Menu));
|
||||
|
||||
for(i = 0; i < conf.nmenu; ++i)
|
||||
{
|
||||
|
||||
@ -174,6 +174,8 @@ void uicb_client_swap_prev(uicb_t);
|
||||
void uicb_client_kill(uicb_t);
|
||||
void uicb_client_screen_next(uicb_t);
|
||||
void uicb_client_screen_prev(uicb_t);
|
||||
void uicb_client_move(uicb_t cmd);
|
||||
void uicb_client_resize(uicb_t cmd);
|
||||
|
||||
/* ewmh.c */
|
||||
void ewmh_init_hints(void);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user