From ad89f01b78bb98e7edf0e83db1d8db3f664dc2f5 Mon Sep 17 00:00:00 2001 From: frese Date: Thu, 24 Apr 2003 15:08:24 +0000 Subject: [PATCH] fixed bugs in some structure events fixed a bug in client-message-event --- c/xlib/event-types.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/c/xlib/event-types.c b/c/xlib/event-types.c index 5a03fec..2e012f0 100644 --- a/c/xlib/event-types.c +++ b/c/xlib/event-types.c @@ -145,21 +145,24 @@ s48_value scx_enter_create_window_event(XCreateWindowEvent* xe) { s48_value scx_enter_destroy_window_event(XDestroyWindowEvent* xe) { EENTER_START("scx-destroy-window-event"); - EENTER(4, window, scx_enter_window); + EENTER(4, event, scx_enter_window); + EENTER(5, window, scx_enter_window); EENTER_END(); } s48_value scx_enter_unmap_event(XUnmapEvent* xe) { EENTER_START("scx-unmap-event"); - EENTER(4, window, scx_enter_window); - EENTER(5, from_configure, S48_ENTER_BOOLEAN); + EENTER(4, event, scx_enter_window); + EENTER(5, window, scx_enter_window); + EENTER(6, from_configure, S48_ENTER_BOOLEAN); EENTER_END(); } s48_value scx_enter_map_event(XMapEvent* xe) { EENTER_START("scx-map-event"); - EENTER(4, window, scx_enter_window); - EENTER(5, override_redirect, S48_ENTER_BOOLEAN); + EENTER(4, event, scx_enter_window); + EENTER(5, window, scx_enter_window); + EENTER(6, override_redirect, S48_ENTER_BOOLEAN); EENTER_END(); } @@ -524,21 +527,24 @@ void scx_extract_create_window_event(s48_value e, XCreateWindowEvent* xe) { void scx_extract_destroy_window_event(s48_value e, XDestroyWindowEvent* xe) { EEXTRACT_START("scx-destroy-window-event"); - EEXTRACT(4, window, scx_extract_window); + EEXTRACT(4, event, scx_extract_window); + EEXTRACT(5, window, scx_extract_window); EEXTRACT_END(); } void scx_extract_unmap_event(s48_value e, XUnmapEvent* xe) { EEXTRACT_START("scx-unmap-event"); - EEXTRACT(4, window, scx_extract_window); - EEXTRACT(5, from_configure, S48_EXTRACT_BOOLEAN); + EEXTRACT(4, event, scx_extract_window); + EEXTRACT(5, window, scx_extract_window); + EEXTRACT(6, from_configure, S48_EXTRACT_BOOLEAN); EEXTRACT_END(); } void scx_extract_map_event(s48_value e, XMapEvent* xe) { EEXTRACT_START("scx-map-event"); - EEXTRACT(4, window, scx_extract_window); - EEXTRACT(5, override_redirect, S48_EXTRACT_BOOLEAN); + EEXTRACT(4, event, scx_extract_window); + EEXTRACT(5, window, scx_extract_window); + EEXTRACT(6, override_redirect, S48_EXTRACT_BOOLEAN); EEXTRACT_END(); } @@ -675,13 +681,16 @@ void scx_extract_colormap_event(s48_value e, XColormapEvent* xe) { void scx_extract_client_message_event(s48_value e, XClientMessageEvent* xe) { int nelements, i; - char* data; + char* data; int bytes; EEXTRACT_START("scx-client-message-event"); EEXTRACT(4, window, scx_extract_window); scx_extract_property(S48_RECORD_REF(e, 5), &xe->message_type, &xe->format, &data, &nelements); + if (xe->format == 32) bytes = nelements * 4; + else if (xe->format == 16) bytes = nelements * 2; + else bytes = nelements; for (i = 0; i < 20; i++) - if (i < nelements) + if (i < bytes) xe->data.b[i] = data[i]; else xe->data.b[i] = 0;