all: update

This commit is contained in:
Martin Duquesnoy 2009-02-21 15:42:20 +01:00
parent 6c5356143f
commit fa990be4e6
5 changed files with 38 additions and 48 deletions

View File

@ -293,8 +293,9 @@ enternotify(XCrossingEvent *ev)
{
Client *c;
if(ev->mode != NotifyNormal
if((ev->mode != NotifyNormal
|| ev->detail == NotifyInferior)
&& ev->window != ROOT)
return;
if((c = client_gb_win(ev->window))

View File

@ -132,9 +132,8 @@ init_root(void)
{
XSetWindowAttributes at;
at.event_mask = KeyMask|ButtonMask|MouseMask
|SubstructureRedirectMask|SubstructureNotifyMask
|EnterWindowMask|LeaveWindowMask|StructureNotifyMask;
at.event_mask = KeyMask | ButtonMask | MouseMask
| SubstructureRedirectMask | SubstructureNotifyMask |StructureNotifyMask;
at.cursor = cursor[CurNormal];
XChangeWindowAttributes(dpy, ROOT, CWEventMask | CWCursor, &at);

View File

@ -506,7 +506,7 @@ uicb_togglemax(uicb_t cmd)
return;
}
/** Set the layout
/** Set the layout *CRAP*
* \param cmd uicb_t type
*/
void

View File

@ -40,7 +40,9 @@ mouse_move(Client *c)
{
int ocx = c->geo.x;
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;
Window dw;
XRectangle geo = c->geo;
@ -56,27 +58,25 @@ mouse_move(Client *c)
XQueryPointer(dpy, ROOT, &dw, &dw, &mx, &my, &dint, &dint, &duint);
for(;;)
do
{
XMaskEvent(dpy, MouseMask | ExposureMask | SubstructureRedirectMask, &ev);
if(ev.type == ButtonRelease)
{
XUngrabPointer(dpy, CurrentTime);
return;
}
else if(ev.type == MotionNotify)
if(ev.type == MotionNotify)
{
geo.x = (ocx + (ev.xmotion.x - mx));
geo.y = (ocy + (ev.xmotion.y - my));
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);
}
else if(ev.type == Expose)
expose(&ev.xexpose);
}
XUngrabPointer(dpy, CurrentTime);
return;
}

View File

@ -77,16 +77,6 @@ color_enlight(ulong 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
* \param win Window target
* \param state WM State
@ -110,10 +100,10 @@ _strdup(char const *str)
{
char *ret = NULL;
if (str != NULL)
if(str != NULL)
{
ret = malloc((strlen(str) + 1) * sizeof *ret);
if (ret != NULL)
if(ret != NULL)
strcpy(ret, str);
}