Log XEvents by their written names
All XEvents only got logged with their IDs. It makes more sense to write out the XEvent's name. Also, writing that we received an XEvent and then logging again, that we ignored it, makes no sense.
This commit is contained in:
parent
3c69e1f263
commit
368182f4d7
@ -144,10 +144,13 @@ static int autodetect_dpi(screen_info *scr)
|
||||
|
||||
void screen_check_event(XEvent event)
|
||||
{
|
||||
if (event.type == randr_event_base + RRScreenChangeNotify)
|
||||
if (event.type == randr_event_base + RRScreenChangeNotify) {
|
||||
LOG_D("XEvent: processing 'RRScreenChangeNotify'");
|
||||
randr_update();
|
||||
else
|
||||
LOG_D("XEvent: Ignored '%d'", event.type);
|
||||
|
||||
} else {
|
||||
LOG_D("XEvent: Ignoring '%d'", event.type);
|
||||
}
|
||||
}
|
||||
|
||||
void xinerama_update(void)
|
||||
|
10
src/x11/x.c
10
src/x11/x.c
@ -274,21 +274,23 @@ gboolean x_mainloop_fd_dispatch(GSource *source, GSourceFunc callback, gpointer
|
||||
unsigned int state;
|
||||
while (XPending(xctx.dpy) > 0) {
|
||||
XNextEvent(xctx.dpy, &ev);
|
||||
LOG_D("XEvent: processing '%d'", ev.type);
|
||||
|
||||
switch (ev.type) {
|
||||
case Expose:
|
||||
LOG_D("XEvent: processing 'Expose'");
|
||||
if (ev.xexpose.count == 0 && win->visible) {
|
||||
draw();
|
||||
}
|
||||
break;
|
||||
case ButtonRelease:
|
||||
LOG_D("XEvent: processing 'ButtonRelease'");
|
||||
if (ev.xbutton.window == win->xwin) {
|
||||
x_handle_click(ev);
|
||||
wake_up();
|
||||
}
|
||||
break;
|
||||
case KeyPress:
|
||||
LOG_D("XEvent: processing 'KeyPress'");
|
||||
state = ev.xkey.state;
|
||||
/* NumLock is also encoded in the state. Remove it. */
|
||||
state &= ~x_numlock_mod();
|
||||
@ -325,15 +327,21 @@ gboolean x_mainloop_fd_dispatch(GSource *source, GSourceFunc callback, gpointer
|
||||
}
|
||||
break;
|
||||
case FocusIn:
|
||||
LOG_D("XEvent: processing 'FocusIn'");
|
||||
wake_up();
|
||||
break;
|
||||
case FocusOut:
|
||||
LOG_D("XEvent: processing 'FocusOut'");
|
||||
wake_up();
|
||||
break;
|
||||
case CreateNotify:
|
||||
LOG_D("XEvent: processing 'CreateNotify'");
|
||||
if (win->visible &&
|
||||
ev.xcreatewindow.override_redirect == 0)
|
||||
XRaiseWindow(xctx.dpy, win->xwin);
|
||||
break;
|
||||
case PropertyNotify:
|
||||
LOG_D("XEvent: processing 'PropertyNotify'");
|
||||
fullscreen_now = have_fullscreen_window();
|
||||
scr = get_active_screen();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user