resizemouse() is now an uicb function

This commit is contained in:
Julien Danjou 2007-11-12 14:06:59 +01:00
parent f72c1bb54c
commit 69c235280d
3 changed files with 15 additions and 11 deletions

View file

@ -104,6 +104,7 @@ const NameFuncLink UicbList[] = {
{"setstatustext", uicb_setstatustext},
/* event.c */
{"movemouse", uicb_movemouse},
{"resizemouse", uicb_resizemouse},
{NULL, NULL}
};

24
event.c
View file

@ -102,11 +102,21 @@ uicb_movemouse(awesome_config *awesomeconf, const char *arg __attribute__ ((unus
}
}
static void
resizemouse(Client * c, awesome_config *awesomeconf)
void
uicb_resizemouse(awesome_config *awesomeconf, const char *arg __attribute__ ((unused)))
{
int ocx, ocy, nw, nh;
XEvent ev;
Client *c = get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel;
if(!c)
return;
if((get_current_layout(awesomeconf->tags, awesomeconf->ntags)->arrange != layout_floating)
&& !c->isfloating)
uicb_togglefloating(awesomeconf, "DUMMY");
else
restack(&awesomeconf[c->screen]);
ocx = c->x;
ocy = c->y;
@ -236,15 +246,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
uicb_zoom(&awesomeconf[c->screen], NULL);
}
else if(ev->button == Button3)
{
if((get_current_layout(awesomeconf[c->screen].tags,
awesomeconf[c->screen].ntags)->arrange != layout_floating)
&& !c->isfloating)
uicb_togglefloating(&awesomeconf[c->screen], "DUMMY");
else
restack(&awesomeconf[c->screen]);
resizemouse(c, awesomeconf);
}
uicb_resizemouse(&awesomeconf[c->screen], NULL);
else if(ev->button == Button4)
uicb_settrans(&awesomeconf[c->screen], "+5");
else if(ev->button == Button5)

View file

@ -42,6 +42,7 @@ void handle_event_shape(XEvent *, awesome_config *);
void handle_event_randr_screen_change_notify(XEvent *, awesome_config *);
UICB_PROTO(uicb_movemouse);
UICB_PROTO(uicb_resizemouse);
#endif
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99