From 9c3ad9e13b31eb85dfd4fc401cc858157aa2bce6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 5 Nov 2004 07:05:13 +0000 Subject: [PATCH] * xselect.c (TRACE3): New debug macro. (x_reply_selection_request): Use it. (receive_incremental_selection): In call to TRACE0, the name of a symbol is in xname. --- src/ChangeLog | 7 +++++++ src/xselect.c | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 43bf4f56154..559ffd672d9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2004-11-05 Jan Dj,Ad(Brv + + * xselect.c (TRACE3): New debug macro. + (x_reply_selection_request): Use it. + (receive_incremental_selection): In call to TRACE0, the name of + a symbol is in xname. + 2004-11-05 Kim F. Storm * fontset.c (fontset_pattern_regexp): Use unsigned char. diff --git a/src/xselect.c b/src/xselect.c index 35f4586b754..0d327da85a2 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -85,10 +85,13 @@ static void initialize_cut_buffers P_ ((Display *, Window)); fprintf (stderr, "%d: " fmt "\n", getpid (), a0) #define TRACE2(fmt, a0, a1) \ fprintf (stderr, "%d: " fmt "\n", getpid (), a0, a1) +#define TRACE3(fmt, a0, a1, a2) \ + fprintf (stderr, "%d: " fmt "\n", getpid (), a0, a1, a2) #else #define TRACE0(fmt) (void) 0 #define TRACE1(fmt, a0) (void) 0 #define TRACE2(fmt, a0, a1) (void) 0 +#define TRACE3(fmt, a0, a1) (void) 0 #endif @@ -623,6 +626,17 @@ x_reply_selection_request (event, format, data, size, type) BLOCK_INPUT; count = x_catch_errors (display); +#ifdef TRACE_SELECTION + { + static int cnt; + char *sel = XGetAtomName (display, reply.selection); + char *tgt = XGetAtomName (display, reply.target); + TRACE3 ("%s, target %s (%d)", sel, tgt, ++cnt); + if (sel) XFree (sel); + if (tgt) XFree (tgt); + } +#endif /* TRACE_SELECTION */ + /* Store the data on the requested property. If the selection is large, only store the first N bytes of it. */ @@ -1445,10 +1459,10 @@ receive_incremental_selection (display, window, property, target_type, BLOCK_INPUT; XSelectInput (display, window, STANDARD_EVENT_SET | PropertyChangeMask); TRACE1 (" Delete property %s", - XSYMBOL (x_atom_to_symbol (display, property))->name->data); + SDATA (XSYMBOL (x_atom_to_symbol (display, property))->xname)); XDeleteProperty (display, window, property); TRACE1 (" Expect new value of property %s", - XSYMBOL (x_atom_to_symbol (display, property))->name->data); + SDATA (XSYMBOL (x_atom_to_symbol (display, property))->xname)); wait_object = expect_property_change (display, window, property, PropertyNewValue); XFlush (display); -- 2.39.5