comparison src/xselect.c @ 57948:481911368712

* 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.
author Jan Djärv <jan.h.d@swipnet.se>
date Fri, 05 Nov 2004 07:05:13 +0000
parents c02cbcd40932
children a6f82b95d10b
comparison
equal deleted inserted replaced
57947:678d2c0d522e 57948:481911368712
83 fprintf (stderr, "%d: " fmt "\n", getpid ()) 83 fprintf (stderr, "%d: " fmt "\n", getpid ())
84 #define TRACE1(fmt, a0) \ 84 #define TRACE1(fmt, a0) \
85 fprintf (stderr, "%d: " fmt "\n", getpid (), a0) 85 fprintf (stderr, "%d: " fmt "\n", getpid (), a0)
86 #define TRACE2(fmt, a0, a1) \ 86 #define TRACE2(fmt, a0, a1) \
87 fprintf (stderr, "%d: " fmt "\n", getpid (), a0, a1) 87 fprintf (stderr, "%d: " fmt "\n", getpid (), a0, a1)
88 #define TRACE3(fmt, a0, a1, a2) \
89 fprintf (stderr, "%d: " fmt "\n", getpid (), a0, a1, a2)
88 #else 90 #else
89 #define TRACE0(fmt) (void) 0 91 #define TRACE0(fmt) (void) 0
90 #define TRACE1(fmt, a0) (void) 0 92 #define TRACE1(fmt, a0) (void) 0
91 #define TRACE2(fmt, a0, a1) (void) 0 93 #define TRACE2(fmt, a0, a1) (void) 0
94 #define TRACE3(fmt, a0, a1) (void) 0
92 #endif 95 #endif
93 96
94 97
95 #define CUT_BUFFER_SUPPORT 98 #define CUT_BUFFER_SUPPORT
96 99
621 624
622 /* #### XChangeProperty can generate BadAlloc, and we must handle it! */ 625 /* #### XChangeProperty can generate BadAlloc, and we must handle it! */
623 BLOCK_INPUT; 626 BLOCK_INPUT;
624 count = x_catch_errors (display); 627 count = x_catch_errors (display);
625 628
629 #ifdef TRACE_SELECTION
630 {
631 static int cnt;
632 char *sel = XGetAtomName (display, reply.selection);
633 char *tgt = XGetAtomName (display, reply.target);
634 TRACE3 ("%s, target %s (%d)", sel, tgt, ++cnt);
635 if (sel) XFree (sel);
636 if (tgt) XFree (tgt);
637 }
638 #endif /* TRACE_SELECTION */
639
626 /* Store the data on the requested property. 640 /* Store the data on the requested property.
627 If the selection is large, only store the first N bytes of it. 641 If the selection is large, only store the first N bytes of it.
628 */ 642 */
629 bytes_remaining = size * format_bytes; 643 bytes_remaining = size * format_bytes;
630 if (bytes_remaining <= max_bytes) 644 if (bytes_remaining <= max_bytes)
1443 We are done when the sender places a property of length 0. 1457 We are done when the sender places a property of length 0.
1444 */ 1458 */
1445 BLOCK_INPUT; 1459 BLOCK_INPUT;
1446 XSelectInput (display, window, STANDARD_EVENT_SET | PropertyChangeMask); 1460 XSelectInput (display, window, STANDARD_EVENT_SET | PropertyChangeMask);
1447 TRACE1 (" Delete property %s", 1461 TRACE1 (" Delete property %s",
1448 XSYMBOL (x_atom_to_symbol (display, property))->name->data); 1462 SDATA (XSYMBOL (x_atom_to_symbol (display, property))->xname));
1449 XDeleteProperty (display, window, property); 1463 XDeleteProperty (display, window, property);
1450 TRACE1 (" Expect new value of property %s", 1464 TRACE1 (" Expect new value of property %s",
1451 XSYMBOL (x_atom_to_symbol (display, property))->name->data); 1465 SDATA (XSYMBOL (x_atom_to_symbol (display, property))->xname));
1452 wait_object = expect_property_change (display, window, property, 1466 wait_object = expect_property_change (display, window, property,
1453 PropertyNewValue); 1467 PropertyNewValue);
1454 XFlush (display); 1468 XFlush (display);
1455 UNBLOCK_INPUT; 1469 UNBLOCK_INPUT;
1456 1470