all: update
This commit is contained in:
parent
6c5356143f
commit
fa990be4e6
@ -293,8 +293,9 @@ enternotify(XCrossingEvent *ev)
|
|||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
if(ev->mode != NotifyNormal
|
if((ev->mode != NotifyNormal
|
||||||
|| ev->detail == NotifyInferior)
|
|| ev->detail == NotifyInferior)
|
||||||
|
&& ev->window != ROOT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if((c = client_gb_win(ev->window))
|
if((c = client_gb_win(ev->window))
|
||||||
|
|||||||
@ -132,9 +132,8 @@ init_root(void)
|
|||||||
{
|
{
|
||||||
XSetWindowAttributes at;
|
XSetWindowAttributes at;
|
||||||
|
|
||||||
at.event_mask = KeyMask|ButtonMask|MouseMask
|
at.event_mask = KeyMask | ButtonMask | MouseMask
|
||||||
|SubstructureRedirectMask|SubstructureNotifyMask
|
| SubstructureRedirectMask | SubstructureNotifyMask |StructureNotifyMask;
|
||||||
|EnterWindowMask|LeaveWindowMask|StructureNotifyMask;
|
|
||||||
|
|
||||||
at.cursor = cursor[CurNormal];
|
at.cursor = cursor[CurNormal];
|
||||||
XChangeWindowAttributes(dpy, ROOT, CWEventMask | CWCursor, &at);
|
XChangeWindowAttributes(dpy, ROOT, CWEventMask | CWCursor, &at);
|
||||||
|
|||||||
@ -506,7 +506,7 @@ uicb_togglemax(uicb_t cmd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set the layout
|
/** Set the layout *CRAP*
|
||||||
* \param cmd uicb_t type
|
* \param cmd uicb_t type
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
|||||||
26
src/mouse.c
26
src/mouse.c
@ -40,7 +40,9 @@ mouse_move(Client *c)
|
|||||||
{
|
{
|
||||||
int ocx = c->geo.x;
|
int ocx = c->geo.x;
|
||||||
int ocy = c->geo.y;
|
int ocy = c->geo.y;
|
||||||
int mx = 0, my = 0, dint;
|
int mx = c->geo.x;
|
||||||
|
int my = c->geo.y;
|
||||||
|
int dint;
|
||||||
uint duint;
|
uint duint;
|
||||||
Window dw;
|
Window dw;
|
||||||
XRectangle geo = c->geo;
|
XRectangle geo = c->geo;
|
||||||
@ -56,27 +58,25 @@ mouse_move(Client *c)
|
|||||||
|
|
||||||
XQueryPointer(dpy, ROOT, &dw, &dw, &mx, &my, &dint, &dint, &duint);
|
XQueryPointer(dpy, ROOT, &dw, &dw, &mx, &my, &dint, &dint, &duint);
|
||||||
|
|
||||||
for(;;)
|
do
|
||||||
{
|
{
|
||||||
XMaskEvent(dpy, MouseMask | ExposureMask | SubstructureRedirectMask, &ev);
|
XMaskEvent(dpy, MouseMask | ExposureMask | SubstructureRedirectMask, &ev);
|
||||||
|
|
||||||
if(ev.type == ButtonRelease)
|
if(ev.type == MotionNotify)
|
||||||
{
|
|
||||||
XUngrabPointer(dpy, CurrentTime);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if(ev.type == MotionNotify)
|
|
||||||
{
|
{
|
||||||
geo.x = (ocx + (ev.xmotion.x - mx));
|
geo.x = (ocx + (ev.xmotion.x - mx));
|
||||||
geo.y = (ocy + (ev.xmotion.y - my));
|
geo.y = (ocy + (ev.xmotion.y - my));
|
||||||
|
|
||||||
client_moveresize(c, geo, True);
|
client_moveresize(c, geo, True);
|
||||||
|
}
|
||||||
|
else if(ev.type == MapRequest
|
||||||
|
|| ev.type == Expose
|
||||||
|
|| ev.type == ConfigureRequest)
|
||||||
|
getevent(ev);
|
||||||
|
}
|
||||||
|
while(ev.type != ButtonRelease);
|
||||||
|
|
||||||
XSync(dpy, False);
|
XUngrabPointer(dpy, CurrentTime);
|
||||||
}
|
|
||||||
else if(ev.type == Expose)
|
|
||||||
expose(&ev.xexpose);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
14
src/util.c
14
src/util.c
@ -77,16 +77,6 @@ color_enlight(ulong col)
|
|||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Round function
|
|
||||||
* \param x double type
|
|
||||||
* \return the round of x
|
|
||||||
*/
|
|
||||||
double
|
|
||||||
round(double x)
|
|
||||||
{
|
|
||||||
return (x > 0) ? x + 0.5 : x - 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Set the window WM State
|
/** Set the window WM State
|
||||||
* \param win Window target
|
* \param win Window target
|
||||||
* \param state WM State
|
* \param state WM State
|
||||||
@ -110,10 +100,10 @@ _strdup(char const *str)
|
|||||||
{
|
{
|
||||||
char *ret = NULL;
|
char *ret = NULL;
|
||||||
|
|
||||||
if (str != NULL)
|
if(str != NULL)
|
||||||
{
|
{
|
||||||
ret = malloc((strlen(str) + 1) * sizeof *ret);
|
ret = malloc((strlen(str) + 1) * sizeof *ret);
|
||||||
if (ret != NULL)
|
if(ret != NULL)
|
||||||
strcpy(ret, str);
|
strcpy(ret, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user