mirror of
https://github.com/k0kubun/xremap
synced 2024-11-02 03:40:25 +00:00
Output ClientMessage to help debug
In my environment, detected unexpected event is only ClientMessage. ``` % journalctl | grep 'unexpected event detected' | cut -d! -f2 | sort | uniq (33) ```
This commit is contained in:
parent
64eef405a6
commit
f1ece680c2
@ -1,10 +1,26 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <inttypes.h>
|
||||
#include <mruby.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include "xremap.h"
|
||||
|
||||
void
|
||||
print_client_message_event(XClientMessageEvent *event)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"received ClientMesssage(message_type=%" PRIu32 " format=%d data=%#lx, %#lx, %#lx, %#lx, %#lx)",
|
||||
(uint32_t)event->message_type,
|
||||
event->format,
|
||||
(unsigned long)event->data.l[0],
|
||||
(unsigned long)event->data.l[1],
|
||||
(unsigned long)event->data.l[2],
|
||||
(unsigned long)event->data.l[3],
|
||||
(unsigned long)event->data.l[4]);
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
error_handler(Display *display, XErrorEvent *event)
|
||||
{
|
||||
@ -32,6 +48,8 @@ event_loop(Display *display, mrb_state *mrb, mrb_value event_handler)
|
||||
case MappingNotify:
|
||||
handle_mapping_notify(mrb, event_handler);
|
||||
break;
|
||||
case ClientMessage:
|
||||
print_client_message_event((XClientMessageEvent*)&event);
|
||||
default:
|
||||
fprintf(stderr, "unexpected event detected! (%d)\n", event.type);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user