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

@ -75,10 +75,10 @@ buttonpress(XButtonEvent *ev)
if(ev->window == infobar[selscreen].tags[i]->win)
switch(ev->button)
{
case Button1: tag_set(i); break;
case Button3: tag_transfert(sel, i); break;
case Button4: tag_set(seltag[selscreen] + 1); break;
case Button5: tag_set(seltag[selscreen] - 1); break;
case Button1: tag_set(i); break;
case Button3: tag_transfert(sel, i); break;
case Button4: tag_set(seltag[selscreen] + 1); break;
case Button5: tag_set(seltag[selscreen] - 1); break;
}
/* Layout button */
@ -98,8 +98,8 @@ buttonpress(XButtonEvent *ev)
{
switch(ev->button)
{
case Button1: case Button4: layoutswitch(True); break;
case Button3: case Button5: layoutswitch(False); break;
case Button1: case Button4: layoutswitch(True); break;
case Button3: case Button5: layoutswitch(False); break;
}
}
}
@ -293,8 +293,9 @@ enternotify(XCrossingEvent *ev)
{
Client *c;
if(ev->mode != NotifyNormal
|| ev->detail == NotifyInferior)
if((ev->mode != NotifyNormal
|| ev->detail == NotifyInferior)
&& ev->window != ROOT)
return;
if((c = client_gb_win(ev->window))
@ -482,18 +483,18 @@ getevent(XEvent ev)
switch (ev.type)
{
case ButtonPress: buttonpress(&ev.xbutton); break;
case ClientMessage: clientmessageevent(&ev.xclient); break;
case ConfigureRequest: configureevent(&ev); break;
case DestroyNotify: destroynotify(&ev.xdestroywindow); break;
case EnterNotify: enternotify(&ev.xcrossing); break;
case Expose: expose(&ev.xexpose); break;
case FocusIn: focusin(&ev.xfocus); break;
case KeyPress: keypress(&ev.xkey); break;
case MapRequest: maprequest(&ev.xmaprequest); break;
case MappingNotify: mappingnotify(&ev.xmapping); break;
case PropertyNotify: propertynotify(&ev.xproperty); break;
case UnmapNotify: unmapnotify(&ev.xunmap); break;
case ButtonPress: buttonpress(&ev.xbutton); break;
case ClientMessage: clientmessageevent(&ev.xclient); break;
case ConfigureRequest: configureevent(&ev); break;
case DestroyNotify: destroynotify(&ev.xdestroywindow); break;
case EnterNotify: enternotify(&ev.xcrossing); break;
case Expose: expose(&ev.xexpose); break;
case FocusIn: focusin(&ev.xfocus); break;
case KeyPress: keypress(&ev.xkey); break;
case MapRequest: maprequest(&ev.xmaprequest); break;
case MappingNotify: mappingnotify(&ev.xmapping); break;
case PropertyNotify: propertynotify(&ev.xproperty); break;
case UnmapNotify: unmapnotify(&ev.xunmap); break;
}
wait(&st);

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);
XSync(dpy, False);
}
else if(ev.type == Expose)
expose(&ev.xexpose);
else if(ev.type == MapRequest
|| ev.type == Expose
|| ev.type == ConfigureRequest)
getevent(ev);
}
while(ev.type != ButtonRelease);
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);
}