mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
(mostly) proper xshape event support
ok oga@
This commit is contained in:
parent
160228210b
commit
96d7310b4a
1
calmwm.h
1
calmwm.h
@ -384,6 +384,7 @@ void xev_handle_keypress(struct xevent *, XEvent *);
|
|||||||
void xev_handle_keyrelease(struct xevent *, XEvent *);
|
void xev_handle_keyrelease(struct xevent *, XEvent *);
|
||||||
void xev_handle_expose(struct xevent *, XEvent *);
|
void xev_handle_expose(struct xevent *, XEvent *);
|
||||||
void xev_handle_clientmessage(struct xevent *, XEvent *);
|
void xev_handle_clientmessage(struct xevent *, XEvent *);
|
||||||
|
void xev_handle_shape(struct xevent *, XEvent *);
|
||||||
|
|
||||||
#define XEV_QUICK(a, b, c, d, e) do { \
|
#define XEV_QUICK(a, b, c, d, e) do { \
|
||||||
xev_register(xev_new(a, b, c, d, e)); \
|
xev_register(xev_new(a, b, c, d, e)); \
|
||||||
|
3
client.c
3
client.c
@ -140,7 +140,6 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
|
|||||||
CWOverrideRedirect | CWBackPixel | CWEventMask, &pxattr);
|
CWOverrideRedirect | CWBackPixel | CWEventMask, &pxattr);
|
||||||
|
|
||||||
cc->active = 0;
|
cc->active = 0;
|
||||||
client_draw_border(cc);
|
|
||||||
|
|
||||||
XAddToSaveSet(X_Dpy, cc->win);
|
XAddToSaveSet(X_Dpy, cc->win);
|
||||||
XSetWindowBorderWidth(X_Dpy, cc->win, 0);
|
XSetWindowBorderWidth(X_Dpy, cc->win, 0);
|
||||||
@ -463,8 +462,6 @@ client_draw_border(struct client_ctx *cc)
|
|||||||
|
|
||||||
XClearWindow(X_Dpy, cc->pwin);
|
XClearWindow(X_Dpy, cc->pwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
client_do_shape(cc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u_long
|
u_long
|
||||||
|
2
grab.c
2
grab.c
@ -94,6 +94,7 @@ grab_sweep(struct client_ctx *cc)
|
|||||||
cc->bwidth, cc->bwidth,
|
cc->bwidth, cc->bwidth,
|
||||||
cc->geom.width, cc->geom.height);
|
cc->geom.width, cc->geom.height);
|
||||||
|
|
||||||
|
client_do_shape(cc);
|
||||||
break;
|
break;
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
XUnmapWindow(X_Dpy, sc->menuwin);
|
XUnmapWindow(X_Dpy, sc->menuwin);
|
||||||
@ -107,7 +108,6 @@ grab_sweep(struct client_ctx *cc)
|
|||||||
cc->ptr.y = cc->geom.height - cc->bwidth;
|
cc->ptr.y = cc->geom.height - cc->bwidth;
|
||||||
client_ptrwarp(cc);
|
client_ptrwarp(cc);
|
||||||
|
|
||||||
client_do_shape(cc);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
19
xevents.c
19
xevents.c
@ -260,7 +260,6 @@ xev_handle_buttonrelease(struct xevent *xev, XEvent *ee)
|
|||||||
group_sticky_toggle_exit(cc);
|
group_sticky_toggle_exit(cc);
|
||||||
|
|
||||||
xev_register(xev);
|
xev_register(xev);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -354,6 +353,16 @@ out:
|
|||||||
xev_register(xev);
|
xev_register(xev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
xev_handle_shape(struct xevent *xev, XEvent *ee)
|
||||||
|
{
|
||||||
|
XShapeEvent *sev = (XShapeEvent *) ee;
|
||||||
|
struct client_ctx *cc;
|
||||||
|
|
||||||
|
if ((cc = client_find(sev->window)) != NULL)
|
||||||
|
client_do_shape(cc);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* X Event handling
|
* X Event handling
|
||||||
*/
|
*/
|
||||||
@ -411,8 +420,10 @@ xev_handle_expose(struct xevent *xev, XEvent *ee)
|
|||||||
XExposeEvent *e = &ee->xexpose;
|
XExposeEvent *e = &ee->xexpose;
|
||||||
struct client_ctx *cc;
|
struct client_ctx *cc;
|
||||||
|
|
||||||
if ((cc = client_find(e->window)) != NULL && e->count == 0)
|
if ((cc = client_find(e->window)) != NULL && e->count == 0) {
|
||||||
client_draw_border(cc);
|
client_draw_border(cc);
|
||||||
|
client_do_shape(cc);
|
||||||
|
}
|
||||||
|
|
||||||
xev_register(xev);
|
xev_register(xev);
|
||||||
}
|
}
|
||||||
@ -478,7 +489,9 @@ xev_loop(void)
|
|||||||
case ClientMessage:
|
case ClientMessage:
|
||||||
ASSIGN1(xclient);
|
ASSIGN1(xclient);
|
||||||
break;
|
break;
|
||||||
default: /* XXX - still need shape event support. */
|
default:
|
||||||
|
if (e.type == Shape_ev)
|
||||||
|
xev_handle_shape(xev, &e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user