/[rdesktop]/sourceforge.net/trunk/rdesktop/xclip.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/xclip.c

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

revision 1027 by forsberg, Mon Nov 14 14:11:42 2005 UTC revision 1028 by astrand, Mon Nov 14 14:46:16 2005 UTC
# Line 201  xclip_handle_SelectionNotify(XSelectionE Line 201  xclip_handle_SelectionNotify(XSelectionE
201                  XFree(data);                  XFree(data);
202                  g_waiting_for_INCR = 1;                  g_waiting_for_INCR = 1;
203                  return;                  return;
204          }          }
205            
206          XDeleteProperty(g_display, g_wnd, rdesktop_clipboard_target_atom);          XDeleteProperty(g_display, g_wnd, rdesktop_clipboard_target_atom);
207                    
208          /* Negotiate target format */          /* Negotiate target format */
209          if (event->target == targets_atom)          if (event->target == targets_atom)
210          {          {
# Line 255  xclip_handle_SelectionNotify(XSelectionE Line 255  xclip_handle_SelectionNotify(XSelectionE
255                  cliprdr_send_simple_native_format_announce(CF_TEXT);                  cliprdr_send_simple_native_format_announce(CF_TEXT);
256          return;          return;
257    
258   fail:        fail:
259          XDeleteProperty(g_display, g_wnd, rdesktop_clipboard_target_atom);          XDeleteProperty(g_display, g_wnd, rdesktop_clipboard_target_atom);
260          XFree(data);          XFree(data);
261          cliprdr_send_data(NULL, 0);          cliprdr_send_data(NULL, 0);
# Line 326  xclip_handle_SelectionClear(void) Line 326  xclip_handle_SelectionClear(void)
326  void  void
327  xclip_handle_PropertyNotify(XPropertyEvent * event)  xclip_handle_PropertyNotify(XPropertyEvent * event)
328  {  {
329          unsigned long nitems;          unsigned long nitems;
330          unsigned long offset = 0;          unsigned long offset = 0;
331          unsigned long bytes_left = 1;          unsigned long bytes_left = 1;
332          int format, res;          int format, res;
# Line 338  xclip_handle_PropertyNotify(XPropertyEve Line 338  xclip_handle_PropertyNotify(XPropertyEve
338          {          {
339                  DEBUG_CLIPBOARD(("x_clip_handle_PropertyNotify: g_waiting_for_INCR != 0\n"));                  DEBUG_CLIPBOARD(("x_clip_handle_PropertyNotify: g_waiting_for_INCR != 0\n"));
340    
341                  while (bytes_left > 0) {                  while (bytes_left > 0)
342                          if ((XGetWindowProperty(g_display, g_wnd, rdesktop_clipboard_target_atom, offset,                  {
343                                                  4096L, False, AnyPropertyType,                          if ((XGetWindowProperty
344                                                  &type, &format, &nitems, &bytes_left, &data) != Success))                               (g_display, g_wnd, rdesktop_clipboard_target_atom, offset, 4096L,
345                                  False, AnyPropertyType, &type, &format, &nitems, &bytes_left,
346                                  &data) != Success))
347                          {                          {
348                                  XFree(data);                                  XFree(data);
349                                  return;                                  return;
# Line 350  xclip_handle_PropertyNotify(XPropertyEve Line 352  xclip_handle_PropertyNotify(XPropertyEve
352                          if (nitems == 0)                          if (nitems == 0)
353                          {                          {
354                                  XGetWindowAttributes(g_display, g_wnd, &wa);                                  XGetWindowAttributes(g_display, g_wnd, &wa);
355                                  XSelectInput(g_display, g_wnd, (wa.your_event_mask ^ PropertyChangeMask));                                  XSelectInput(g_display, g_wnd,
356                                                 (wa.your_event_mask ^ PropertyChangeMask));
357                                  XFree(data);                                  XFree(data);
358                                  g_waiting_for_INCR = 0;                                  g_waiting_for_INCR = 0;
359    
# Line 372  xclip_handle_PropertyNotify(XPropertyEve Line 375  xclip_handle_PropertyNotify(XPropertyEve
375                                  uint32 length = nitems;                                  uint32 length = nitems;
376                                  uint8 *tmp;                                  uint8 *tmp;
377    
378                                  offset += (length/4);                                  offset += (length / 4);
379                                  DEBUG_CLIPBOARD(("Translating linebreaks before sending data\n"));                                  DEBUG_CLIPBOARD(("Translating linebreaks before sending data\n"));
380                                  translated_data = lf2crlf(data, &length);                                  translated_data = lf2crlf(data, &length);
381    
# Line 380  xclip_handle_PropertyNotify(XPropertyEve Line 383  xclip_handle_PropertyNotify(XPropertyEve
383                                  strncpy((char *) tmp, (char *) g_clip_buffer, g_clip_buflen);                                  strncpy((char *) tmp, (char *) g_clip_buffer, g_clip_buflen);
384                                  xfree(g_clip_buffer);                                  xfree(g_clip_buffer);
385    
386                                  strncpy((char *) (tmp + g_clip_buflen), (char *) translated_data, length);                                  strncpy((char *) (tmp + g_clip_buflen), (char *) translated_data,
387                                            length);
388                                  xfree(translated_data);                                  xfree(translated_data);
389    
390                                  g_clip_buffer = tmp;                                  g_clip_buffer = tmp;

Legend:
Removed from v.1027  
changed lines
  Added in v.1028

  ViewVC Help
Powered by ViewVC 1.1.26