mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
add debugging for x events
This commit is contained in:
parent
34e15dbd7a
commit
8623c7add7
28
xevents.c
28
xevents.c
@ -77,6 +77,8 @@ xev_handle_maprequest(XEvent *ee)
|
|||||||
XMapRequestEvent *e = &ee->xmaprequest;
|
XMapRequestEvent *e = &ee->xmaprequest;
|
||||||
struct client_ctx *cc = NULL, *old_cc;
|
struct client_ctx *cc = NULL, *old_cc;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", e->window);
|
||||||
|
|
||||||
if ((old_cc = client_current()) != NULL)
|
if ((old_cc = client_current()) != NULL)
|
||||||
client_ptrsave(old_cc);
|
client_ptrsave(old_cc);
|
||||||
|
|
||||||
@ -93,6 +95,8 @@ xev_handle_unmapnotify(XEvent *ee)
|
|||||||
XUnmapEvent *e = &ee->xunmap;
|
XUnmapEvent *e = &ee->xunmap;
|
||||||
struct client_ctx *cc;
|
struct client_ctx *cc;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", e->window);
|
||||||
|
|
||||||
if ((cc = client_find(e->window)) != NULL) {
|
if ((cc = client_find(e->window)) != NULL) {
|
||||||
if (e->send_event) {
|
if (e->send_event) {
|
||||||
client_set_wm_state(cc, WithdrawnState);
|
client_set_wm_state(cc, WithdrawnState);
|
||||||
@ -109,6 +113,8 @@ xev_handle_destroynotify(XEvent *ee)
|
|||||||
XDestroyWindowEvent *e = &ee->xdestroywindow;
|
XDestroyWindowEvent *e = &ee->xdestroywindow;
|
||||||
struct client_ctx *cc;
|
struct client_ctx *cc;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", e->window);
|
||||||
|
|
||||||
if ((cc = client_find(e->window)) != NULL)
|
if ((cc = client_find(e->window)) != NULL)
|
||||||
client_delete(cc);
|
client_delete(cc);
|
||||||
}
|
}
|
||||||
@ -121,6 +127,8 @@ xev_handle_configurerequest(XEvent *ee)
|
|||||||
struct screen_ctx *sc;
|
struct screen_ctx *sc;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", e->window);
|
||||||
|
|
||||||
if ((cc = client_find(e->window)) != NULL) {
|
if ((cc = client_find(e->window)) != NULL) {
|
||||||
sc = cc->sc;
|
sc = cc->sc;
|
||||||
|
|
||||||
@ -174,6 +182,8 @@ xev_handle_propertynotify(XEvent *ee)
|
|||||||
struct screen_ctx *sc;
|
struct screen_ctx *sc;
|
||||||
struct client_ctx *cc;
|
struct client_ctx *cc;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", e->window);
|
||||||
|
|
||||||
if ((cc = client_find(e->window)) != NULL) {
|
if ((cc = client_find(e->window)) != NULL) {
|
||||||
switch (e->atom) {
|
switch (e->atom) {
|
||||||
case XA_WM_NORMAL_HINTS:
|
case XA_WM_NORMAL_HINTS:
|
||||||
@ -209,6 +219,8 @@ xev_handle_enternotify(XEvent *ee)
|
|||||||
XCrossingEvent *e = &ee->xcrossing;
|
XCrossingEvent *e = &ee->xcrossing;
|
||||||
struct client_ctx *cc;
|
struct client_ctx *cc;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", e->window);
|
||||||
|
|
||||||
Last_Event_Time = e->time;
|
Last_Event_Time = e->time;
|
||||||
|
|
||||||
if ((cc = client_find(e->window)) != NULL)
|
if ((cc = client_find(e->window)) != NULL)
|
||||||
@ -223,6 +235,8 @@ xev_handle_buttonpress(XEvent *ee)
|
|||||||
struct screen_ctx *sc;
|
struct screen_ctx *sc;
|
||||||
struct bind_ctx *mb;
|
struct bind_ctx *mb;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", e->window);
|
||||||
|
|
||||||
e->state &= ~IGNOREMODMASK;
|
e->state &= ~IGNOREMODMASK;
|
||||||
|
|
||||||
TAILQ_FOREACH(mb, &Conf.mousebindq, entry) {
|
TAILQ_FOREACH(mb, &Conf.mousebindq, entry) {
|
||||||
@ -259,6 +273,8 @@ xev_handle_buttonrelease(XEvent *ee)
|
|||||||
XButtonEvent *e = &ee->xbutton;
|
XButtonEvent *e = &ee->xbutton;
|
||||||
struct client_ctx *cc;
|
struct client_ctx *cc;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", ee->xbutton.window);
|
||||||
|
|
||||||
if ((cc = client_find(e->window)) != NULL) {
|
if ((cc = client_find(e->window)) != NULL) {
|
||||||
if (cc->flags & (CLIENT_ACTIVE | CLIENT_HIGHLIGHT)) {
|
if (cc->flags & (CLIENT_ACTIVE | CLIENT_HIGHLIGHT)) {
|
||||||
cc->flags &= ~CLIENT_HIGHLIGHT;
|
cc->flags &= ~CLIENT_HIGHLIGHT;
|
||||||
@ -277,6 +293,8 @@ xev_handle_keypress(XEvent *ee)
|
|||||||
KeySym keysym, skeysym;
|
KeySym keysym, skeysym;
|
||||||
unsigned int modshift;
|
unsigned int modshift;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", e->window);
|
||||||
|
|
||||||
keysym = XkbKeycodeToKeysym(X_Dpy, e->keycode, 0, 0);
|
keysym = XkbKeycodeToKeysym(X_Dpy, e->keycode, 0, 0);
|
||||||
skeysym = XkbKeycodeToKeysym(X_Dpy, e->keycode, 0, 1);
|
skeysym = XkbKeycodeToKeysym(X_Dpy, e->keycode, 0, 1);
|
||||||
|
|
||||||
@ -328,6 +346,8 @@ xev_handle_keyrelease(XEvent *ee)
|
|||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", e->window);
|
||||||
|
|
||||||
if ((sc = screen_find(e->root)) == NULL)
|
if ((sc = screen_find(e->root)) == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -357,6 +377,8 @@ xev_handle_clientmessage(XEvent *ee)
|
|||||||
struct client_ctx *cc, *old_cc;
|
struct client_ctx *cc, *old_cc;
|
||||||
struct screen_ctx *sc;
|
struct screen_ctx *sc;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", e->window);
|
||||||
|
|
||||||
if (e->message_type == cwmh[WM_CHANGE_STATE]) {
|
if (e->message_type == cwmh[WM_CHANGE_STATE]) {
|
||||||
if ((cc = client_find(e->window)) != NULL) {
|
if ((cc = client_find(e->window)) != NULL) {
|
||||||
if (e->data.l[0] == IconicState)
|
if (e->data.l[0] == IconicState)
|
||||||
@ -404,6 +426,8 @@ xev_handle_randr(XEvent *ee)
|
|||||||
struct screen_ctx *sc;
|
struct screen_ctx *sc;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
DPRINTF("new size: %d/%d", rev->width, rev->height);
|
||||||
|
|
||||||
i = XRRRootToScreen(X_Dpy, rev->root);
|
i = XRRRootToScreen(X_Dpy, rev->root);
|
||||||
TAILQ_FOREACH(sc, &Screenq, entry) {
|
TAILQ_FOREACH(sc, &Screenq, entry) {
|
||||||
if (sc->which == i) {
|
if (sc->which == i) {
|
||||||
@ -424,6 +448,8 @@ xev_handle_mappingnotify(XEvent *ee)
|
|||||||
XMappingEvent *e = &ee->xmapping;
|
XMappingEvent *e = &ee->xmapping;
|
||||||
struct screen_ctx *sc;
|
struct screen_ctx *sc;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", e->window);
|
||||||
|
|
||||||
XRefreshKeyboardMapping(e);
|
XRefreshKeyboardMapping(e);
|
||||||
if (e->request == MappingKeyboard) {
|
if (e->request == MappingKeyboard) {
|
||||||
TAILQ_FOREACH(sc, &Screenq, entry)
|
TAILQ_FOREACH(sc, &Screenq, entry)
|
||||||
@ -437,6 +463,8 @@ xev_handle_expose(XEvent *ee)
|
|||||||
XExposeEvent *e = &ee->xexpose;
|
XExposeEvent *e = &ee->xexpose;
|
||||||
struct client_ctx *cc;
|
struct client_ctx *cc;
|
||||||
|
|
||||||
|
DPRINTF("window: 0x%lx", e->window);
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user