aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/detail/x11.c')
-rw-r--r--pugl/detail/x11.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index 9c9fdfa..ae00f73 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -84,6 +84,7 @@ puglInitWorldInternals(void)
impl->atoms.UTF8_STRING = XInternAtom(display, "UTF8_STRING", 0);
impl->atoms.WM_PROTOCOLS = XInternAtom(display, "WM_PROTOCOLS", 0);
impl->atoms.WM_DELETE_WINDOW = XInternAtom(display, "WM_DELETE_WINDOW", 0);
+ impl->atoms.PUGL_CLIENT_MSG = XInternAtom(display, "_PUGL_CLIENT_MSG", 0);
impl->atoms.NET_WM_NAME = XInternAtom(display, "_NET_WM_NAME", 0);
impl->atoms.NET_WM_STATE = XInternAtom(display, "_NET_WM_STATE", 0);
impl->atoms.NET_WM_STATE_DEMANDS_ATTENTION =
@@ -429,6 +430,10 @@ translateEvent(PuglView* view, XEvent xevent)
if (protocol == atoms->WM_DELETE_WINDOW) {
event.type = PUGL_CLOSE;
}
+ } else if (xevent.xclient.message_type == atoms->PUGL_CLIENT_MSG) {
+ event.type = PUGL_CLIENT;
+ event.client.data1 = xevent.xclient.data.l[0];
+ event.client.data2 = xevent.xclient.data.l[1];
}
break;
case VisibilityNotify:
@@ -613,6 +618,18 @@ puglEventToX(PuglView* view, const PuglEvent* event)
break;
}
+ case PUGL_CLIENT:
+ xev.xclient.type = ClientMessage;
+ xev.xclient.serial = 0;
+ xev.xclient.send_event = True;
+ xev.xclient.display = view->impl->display;
+ xev.xclient.window = view->impl->win;
+ xev.xclient.message_type = view->world->impl->atoms.PUGL_CLIENT_MSG;
+ xev.xclient.format = 32;
+ xev.xclient.data.l[0] = event->client.data1;
+ xev.xclient.data.l[1] = event->client.data2;
+ break;
+
default:
break;
}
@@ -620,7 +637,7 @@ puglEventToX(PuglView* view, const PuglEvent* event)
return xev;
}
-static PuglStatus
+PuglStatus
puglSendEvent(PuglView* view, const PuglEvent* event)
{
XEvent xev = puglEventToX(view, event);