/[emacs]/emacs/src/xselect.c
ViewVC logotype

Diff of /emacs/src/xselect.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.142 by kfstorm, Fri Nov 5 11:30:31 2004 UTC revision 1.143 by kfstorm, Tue Nov 9 13:26:58 2004 UTC
# Line 24  Boston, MA 02111-1307, USA.  */ Line 24  Boston, MA 02111-1307, USA.  */
24    
25  #include <config.h>  #include <config.h>
26  #include <stdio.h>      /* termhooks.h needs this */  #include <stdio.h>      /* termhooks.h needs this */
27    
28    #ifdef HAVE_SYS_TYPES_H
29    #include <sys/types.h>
30    #endif
31    #ifdef HAVE_UNISTD_H
32    #include <unistd.h>
33    #endif
34    
35  #include "lisp.h"  #include "lisp.h"
36  #include "xterm.h"      /* for all of the X includes */  #include "xterm.h"      /* for all of the X includes */
37  #include "dispextern.h" /* frame.h seems to want this */  #include "dispextern.h" /* frame.h seems to want this */
# Line 174  static Lisp_Object x_get_window_property Line 182  static Lisp_Object x_get_window_property
182    
183    
184    
185  /* Define a queue to save up SelectionRequest events for later handling.  */  /* Define a queue to save up SELECTION_REQUEST_EVENT events for later
186       handling.  */
187    
188  struct selection_event_queue  struct selection_event_queue
189    {    {
# Line 184  struct selection_event_queue Line 193  struct selection_event_queue
193    
194  static struct selection_event_queue *selection_queue;  static struct selection_event_queue *selection_queue;
195    
196  /* Nonzero means queue up certain events--don't process them yet.  */  /* Nonzero means queue up SELECTION_REQUEST_EVENT events.  */
197    
198  static int x_queue_selection_requests;  static int x_queue_selection_requests;
199    
200  /* Queue up an X event *EVENT, to be processed later.  */  /* Queue up an SELECTION_REQUEST_EVENT *EVENT, to be processed later.  */
201    
202  static void  static void
203  x_queue_event (event)  x_queue_event (event)
# Line 196  x_queue_event (event) Line 205  x_queue_event (event)
205  {  {
206    struct selection_event_queue *queue_tmp;    struct selection_event_queue *queue_tmp;
207    
208    /* Don't queue repeated requests */    /* Don't queue repeated requests.
209         This only happens for large requests which uses the incremental protocol.  */
210    for (queue_tmp = selection_queue; queue_tmp; queue_tmp = queue_tmp->next)    for (queue_tmp = selection_queue; queue_tmp; queue_tmp = queue_tmp->next)
211      {      {
212        if (!bcmp (&queue_tmp->event, event, sizeof (*event)))        if (!bcmp (&queue_tmp->event, event, sizeof (*event)))
213          {          {
214            TRACE1 ("IGNORE DUP SELECTION EVENT %08x", (unsigned long)queue_tmp);            TRACE1 ("DECLINE DUP SELECTION EVENT %08lx", (unsigned long)queue_tmp);
215              x_decline_selection_request (event);
216            return;            return;
217          }          }
218      }      }
# Line 211  x_queue_event (event) Line 222  x_queue_event (event)
222    
223    if (queue_tmp != NULL)    if (queue_tmp != NULL)
224      {      {
225        TRACE1 ("QUEUE SELECTION EVENT %08x", (unsigned long)queue_tmp);        TRACE1 ("QUEUE SELECTION EVENT %08lx", (unsigned long)queue_tmp);
226        queue_tmp->event = *event;        queue_tmp->event = *event;
227        queue_tmp->next = selection_queue;        queue_tmp->next = selection_queue;
228        selection_queue = queue_tmp;        selection_queue = queue_tmp;
229      }      }
230  }  }
231    
232  /* Start queuing SelectionRequest events.  */  /* Start queuing SELECTION_REQUEST_EVENT events.  */
233    
234  static void  static void
235  x_start_queuing_selection_requests ()  x_start_queuing_selection_requests ()
# Line 230  x_start_queuing_selection_requests () Line 241  x_start_queuing_selection_requests ()
241    TRACE1 ("x_start_queuing_selection_requests %d", x_queue_selection_requests);    TRACE1 ("x_start_queuing_selection_requests %d", x_queue_selection_requests);
242  }  }
243    
244  /* Stop queuing SelectionRequest events.  */  /* Stop queuing SELECTION_REQUEST_EVENT events.  */
245    
246  static void  static void
247  x_stop_queuing_selection_requests ()  x_stop_queuing_selection_requests ()
# Line 244  x_stop_queuing_selection_requests () Line 255  x_stop_queuing_selection_requests ()
255    while (selection_queue != NULL)    while (selection_queue != NULL)
256      {      {
257        struct selection_event_queue *queue_tmp = selection_queue;        struct selection_event_queue *queue_tmp = selection_queue;
258        TRACE1 ("RESTORE SELECTION EVENT %08x", (unsigned long)queue_tmp);        TRACE1 ("RESTORE SELECTION EVENT %08lx", (unsigned long)queue_tmp);
259        kbd_buffer_unget_event (&queue_tmp->event);        kbd_buffer_unget_event (&queue_tmp->event);
260        selection_queue = queue_tmp->next;        selection_queue = queue_tmp->next;
261        xfree ((char *)queue_tmp);        xfree ((char *)queue_tmp);
# Line 869  x_handle_selection_request (event) Line 880  x_handle_selection_request (event)
880    struct x_display_info *dpyinfo    struct x_display_info *dpyinfo
881      = x_display_info_for_display (SELECTION_EVENT_DISPLAY (event));      = x_display_info_for_display (SELECTION_EVENT_DISPLAY (event));
882    
883    TRACE0 ("x_handle_selection_request");    TRACE2 ("x_handle_selection_request, from=0x%08lx time=%lu",
884              (unsigned long) SELECTION_EVENT_REQUESTOR (event),
885              (unsigned long) SELECTION_EVENT_TIME (event));
886    
887    local_selection_data = Qnil;    local_selection_data = Qnil;
888    target_symbol = Qnil;    target_symbol = Qnil;

Legend:
Removed from v.1.142  
changed lines
  Added in v.1.143

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26