/[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 1208 by ossman_, Mon Mar 27 10:41:22 2006 UTC revision 1211 by ossman_, Mon Mar 27 12:29:29 2006 UTC
# Line 114  static int have_primary = 0; Line 114  static int have_primary = 0;
114  /* Denotes that an rdesktop (not this rdesktop) is owning the selection,  /* Denotes that an rdesktop (not this rdesktop) is owning the selection,
115     allowing us to interchange Windows native clipboard data directly. */     allowing us to interchange Windows native clipboard data directly. */
116  static int rdesktop_is_selection_owner = 0;  static int rdesktop_is_selection_owner = 0;
117    /* Time when we acquired the selection. */
118    static Time acquire_time = 0;
119    
120  /* Denotes that an INCR ("chunked") transfer is in progress. */  /* Denotes that an INCR ("chunked") transfer is in progress. */
121  static int g_waiting_for_INCR = 0;  static int g_waiting_for_INCR = 0;
# Line 614  xclip_handle_SelectionRequest(XSelection Line 616  xclip_handle_SelectionRequest(XSelection
616          }          }
617          else if (event->target == timestamp_atom)          else if (event->target == timestamp_atom)
618          {          {
619                  xclip_provide_selection(event, XA_INTEGER, 32, (uint8 *) & g_last_gesturetime, 1);                  xclip_provide_selection(event, XA_INTEGER, 32, (uint8 *) & acquire_time, 1);
620                  return;                  return;
621          }          }
622          else          else
# Line 798  xclip_handle_PropertyNotify(XPropertyEve Line 800  xclip_handle_PropertyNotify(XPropertyEve
800  void  void
801  ui_clip_format_announce(uint8 * data, uint32 length)  ui_clip_format_announce(uint8 * data, uint32 length)
802  {  {
803          XSetSelectionOwner(g_display, primary_atom, g_wnd, g_last_gesturetime);          acquire_time = g_last_gesturetime;
804    
805            XSetSelectionOwner(g_display, primary_atom, g_wnd, acquire_time);
806          if (XGetSelectionOwner(g_display, primary_atom) != g_wnd)          if (XGetSelectionOwner(g_display, primary_atom) != g_wnd)
807          {          {
808                  warning("Failed to aquire ownership of PRIMARY clipboard\n");                  warning("Failed to aquire ownership of PRIMARY clipboard\n");
# Line 810  ui_clip_format_announce(uint8 * data, ui Line 814  ui_clip_format_announce(uint8 * data, ui
814                          rdesktop_clipboard_formats_atom, XA_STRING, 8, PropModeReplace, data,                          rdesktop_clipboard_formats_atom, XA_STRING, 8, PropModeReplace, data,
815                          length);                          length);
816    
817          XSetSelectionOwner(g_display, clipboard_atom, g_wnd, g_last_gesturetime);          XSetSelectionOwner(g_display, clipboard_atom, g_wnd, acquire_time);
818          if (XGetSelectionOwner(g_display, clipboard_atom) != g_wnd)          if (XGetSelectionOwner(g_display, clipboard_atom) != g_wnd)
819                  warning("Failed to aquire ownership of CLIPBOARD clipboard\n");                  warning("Failed to aquire ownership of CLIPBOARD clipboard\n");
820  }  }
# Line 821  ui_clip_handle_data(uint8 * data, uint32 Line 825  ui_clip_handle_data(uint8 * data, uint32
825  {  {
826          BOOL free_data = False;          BOOL free_data = False;
827    
828            if (length == 0)
829            {
830                    xclip_refuse_selection(&selection_request);
831                    has_selection_request = False;
832                    return;
833            }
834    
835          if (selection_request.target == format_string_atom || selection_request.target == XA_STRING)          if (selection_request.target == format_string_atom || selection_request.target == XA_STRING)
836          {          {
837                  /* We're expecting a CF_TEXT response */                  /* We're expecting a CF_TEXT response */
# Line 888  ui_clip_handle_data(uint8 * data, uint32 Line 899  ui_clip_handle_data(uint8 * data, uint32
899  }  }
900    
901  void  void
902    ui_clip_request_failed()
903    {
904            xclip_refuse_selection(&selection_request);
905            has_selection_request = False;
906    }
907    
908    void
909  ui_clip_request_data(uint32 format)  ui_clip_request_data(uint32 format)
910  {  {
911          Window primary_owner, clipboard_owner;          Window primary_owner, clipboard_owner;

Legend:
Removed from v.1208  
changed lines
  Added in v.1211

  ViewVC Help
Powered by ViewVC 1.1.26