/[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.145 by jhd, Fri Jan 7 16:59:57 2005 UTC revision 1.146 by jhd, Sat Feb 5 16:41:10 2005 UTC
# Line 2536  x_property_data_to_lisp (f, data, type, Line 2536  x_property_data_to_lisp (f, data, type,
2536                                        data, size*format/8, type, format);                                        data, size*format/8, type, format);
2537  }  }
2538    
2539  /* Get the mouse position frame relative coordinates.  */  /* Get the mouse position in frame relative coordinates.  */
2540    
2541  static void  static void
2542  mouse_position_for_drop (f, x, y)  mouse_position_for_drop (f, x, y)
# Line 2635  x_handle_dnd_message (f, event, dpyinfo, Line 2635  x_handle_dnd_message (f, event, dpyinfo,
2635    Lisp_Object frame;    Lisp_Object frame;
2636    unsigned long size = (8*sizeof (event->data))/event->format;    unsigned long size = (8*sizeof (event->data))/event->format;
2637    int x, y;    int x, y;
2638      unsigned char *data = (unsigned char *) event->data.b;
2639      int idata[5];
2640    
2641    XSETFRAME (frame, f);    XSETFRAME (frame, f);
2642    
2643      /* On a 64 bit machine, the event->data.l array members are 64 bits (long),
2644         but the x_property_data_to_lisp (or rather selection_data_to_lisp_data)
2645         function expects them to be of size int (i.e. 32).  So to be able to
2646         use that function, put the data in the form it expects if format is 32. */
2647    
2648      if (event->format == 32 && event->format < BITS_PER_LONG)
2649        {
2650          int i;
2651          for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */
2652            idata[i] = (int) event->data.l[i];
2653          data = (unsigned char *) idata;
2654        }
2655    
2656    vec = Fmake_vector (make_number (4), Qnil);    vec = Fmake_vector (make_number (4), Qnil);
2657    AREF (vec, 0) = SYMBOL_NAME (x_atom_to_symbol (FRAME_X_DISPLAY (f),    AREF (vec, 0) = SYMBOL_NAME (x_atom_to_symbol (FRAME_X_DISPLAY (f),
2658                                                   event->message_type));                                                   event->message_type));
2659    AREF (vec, 1) = frame;    AREF (vec, 1) = frame;
2660    AREF (vec, 2) = make_number (event->format);    AREF (vec, 2) = make_number (event->format);
2661    AREF (vec, 3) = x_property_data_to_lisp (f,    AREF (vec, 3) = x_property_data_to_lisp (f,
2662                                             event->data.b,                                             data,
2663                                             event->message_type,                                             event->message_type,
2664                                             event->format,                                             event->format,
2665                                             size);                                             size);
# Line 2697  are ignored.  */) Line 2712  are ignored.  */)
2712    struct frame *f = check_x_frame (from);    struct frame *f = check_x_frame (from);
2713    int count;    int count;
2714    int to_root;    int to_root;
2715      int idata[5];
2716      void *data;
2717    
2718    CHECK_STRING (message_type);    CHECK_STRING (message_type);
2719    CHECK_NUMBER (format);    CHECK_NUMBER (format);
# Line 2756  are ignored.  */) Line 2773  are ignored.  */)
2773       when sending to the root window.  */       when sending to the root window.  */
2774    event.xclient.window = to_root ? FRAME_OUTER_WINDOW (f) : wdest;    event.xclient.window = to_root ? FRAME_OUTER_WINDOW (f) : wdest;
2775    
2776    memset (event.xclient.data.b, 0, sizeof (event.xclient.data.b));    
2777    x_fill_property_data (dpyinfo->display, values, event.xclient.data.b,    if (event.xclient.format == 32 && event.xclient.format < BITS_PER_LONG)
2778                          event.xclient.format);      {
2779          /* x_fill_property_data expects data to hold 32 bit values when
2780             format == 32, but on a 64 bit machine long is 64 bits.
2781             event.xclient.l is an array of long, so we must compensate. */
2782    
2783          memset (idata, 0, sizeof (idata));
2784          data = idata;
2785        }
2786      else
2787        {
2788          memset (event.xclient.data.b, 0, sizeof (event.xclient.data.b));
2789          data = event.xclient.data.b;
2790        }
2791    
2792      x_fill_property_data (dpyinfo->display, values, data, event.xclient.format);
2793    
2794      if (data == idata)
2795        {
2796          int i;
2797          for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */
2798            event.xclient.data.l[i] = (long) idata[i];
2799        }
2800      
2801    /* If event mask is 0 the event is sent to the client that created    /* If event mask is 0 the event is sent to the client that created
2802       the destination window.  But if we are sending to the root window,       the destination window.  But if we are sending to the root window,
2803       there is no such client.  Then we set the event mask to 0xffff.  The       there is no such client.  Then we set the event mask to 0xffff.  The

Legend:
Removed from v.1.145  
changed lines
  Added in v.1.146

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