~ubuntu-branches/ubuntu/lucid/libx11/lucid

« back to all changes in this revision

Viewing changes to src/PutBEvent.c

  • Committer: Bazaar Package Importer
  • Author(s): Timo Aaltonen
  • Date: 2009-12-04 11:43:54 UTC
  • mfrom: (1.1.10 upstream) (2.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20091204114354-0lik4mbb1bv1a8nw
Tags: 2:1.3.2-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add 100_latin_locale_alias.diff (LP 379785)

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    register XEvent *event)
42
42
        {
43
43
        register _XQEvent *qelt;
 
44
        XEvent store = *event;
44
45
 
45
46
        if (!dpy->qfree) {
46
47
            if ((dpy->qfree = (_XQEvent *) Xmalloc (sizeof (_XQEvent))) == NULL) {
48
49
            }
49
50
            dpy->qfree->next = NULL;
50
51
        }
 
52
 
 
53
        /* unclaimed cookie? */
 
54
        if (_XIsEventCookie(dpy, event))
 
55
        {
 
56
            XEvent copy = {0};
 
57
            /* if not claimed, then just fetch and store again */
 
58
            if (!event->xcookie.data) {
 
59
                _XFetchEventCookie(dpy, &event->xcookie);
 
60
                store = *event;
 
61
            } else { /* if claimed, copy, client must free */
 
62
                _XCopyEventCookie(dpy, &event->xcookie, &copy.xcookie);
 
63
                store = copy;
 
64
            }
 
65
        }
 
66
 
51
67
        qelt = dpy->qfree;
52
68
        dpy->qfree = qelt->next;
53
69
        qelt->qserial_num = dpy->next_event_serial_num++;
54
70
        qelt->next = dpy->head;
55
 
        qelt->event = *event;
 
71
        qelt->event = store;
56
72
        dpy->head = qelt;
57
73
        if (dpy->tail == NULL)
58
74
            dpy->tail = qelt;