movemouse() is now an uicb function
This commit is contained in:
parent
ef7034b0b8
commit
f72c1bb54c
3
config.c
3
config.c
|
@ -33,6 +33,7 @@
|
|||
#include "event.h"
|
||||
#include "tag.h"
|
||||
#include "statusbar.h"
|
||||
#include "event.h"
|
||||
#include "layout.h"
|
||||
#include "layouts/tile.h"
|
||||
#include "layouts/floating.h"
|
||||
|
@ -101,6 +102,8 @@ const NameFuncLink UicbList[] = {
|
|||
/* config.c */
|
||||
{"reloadconfig", uicb_reloadconfig},
|
||||
{"setstatustext", uicb_setstatustext},
|
||||
/* event.c */
|
||||
{"movemouse", uicb_movemouse},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
|
24
event.c
24
event.c
|
@ -39,14 +39,24 @@
|
|||
#define CLEANMASK(mask, screen) (mask & ~(awesomeconf[screen].numlockmask | LockMask))
|
||||
#define MOUSEMASK (BUTTONMASK | PointerMotionMask)
|
||||
|
||||
static void
|
||||
movemouse(Client *c, awesome_config *awesomeconf)
|
||||
void
|
||||
uicb_movemouse(awesome_config *awesomeconf, const char *arg __attribute__ ((unused)))
|
||||
{
|
||||
int x1, y1, ocx, ocy, di, nx, ny;
|
||||
unsigned int dui;
|
||||
Window dummy;
|
||||
XEvent ev;
|
||||
ScreenInfo *si;
|
||||
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[c->screen], "DUMMY");
|
||||
else
|
||||
restack(awesomeconf);
|
||||
|
||||
si = get_screen_info(c->display, c->screen, &awesomeconf[c->screen].statusbar);
|
||||
|
||||
|
@ -215,15 +225,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
|
|||
}
|
||||
}
|
||||
else if(ev->button == Button1)
|
||||
{
|
||||
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]);
|
||||
movemouse(c, awesomeconf);
|
||||
}
|
||||
uicb_movemouse(&awesomeconf[c->screen], NULL);
|
||||
else if(ev->button == Button2)
|
||||
{
|
||||
if((get_current_layout(awesomeconf[c->screen].tags,
|
||||
|
|
2
event.h
2
event.h
|
@ -41,5 +41,7 @@ void handle_event_unmapnotify(XEvent *, awesome_config *);
|
|||
void handle_event_shape(XEvent *, awesome_config *);
|
||||
void handle_event_randr_screen_change_notify(XEvent *, awesome_config *);
|
||||
|
||||
UICB_PROTO(uicb_movemouse);
|
||||
|
||||
#endif
|
||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99
|
||||
|
|
Loading…
Reference in New Issue