/[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 1206 by ossman_, Mon Mar 27 08:49:38 2006 UTC revision 1207 by ossman_, Mon Mar 27 09:20:24 2006 UTC
# Line 53  Line 53 
53  extern Display *g_display;  extern Display *g_display;
54  extern Window g_wnd;  extern Window g_wnd;
55  extern Time g_last_gesturetime;  extern Time g_last_gesturetime;
56    extern BOOL g_rdpclip;
57    
58    /* Mode of operation.
59       - Auto: Look at both PRIMARY and CLIPBOARD and use the most recent.
60       - Non-auto: Look at just CLIPBOARD. */
61    static BOOL auto_mode = True;
62  /* Atoms of the two X selections we're dealing with: CLIPBOARD (explicit-copy) and PRIMARY (selection-copy) */  /* Atoms of the two X selections we're dealing with: CLIPBOARD (explicit-copy) and PRIMARY (selection-copy) */
63  static Atom clipboard_atom, primary_atom;  static Atom clipboard_atom, primary_atom;
64  /* Atom of the TARGETS clipboard target */  /* Atom of the TARGETS clipboard target */
# Line 902  ui_clip_request_data(uint32 format) Line 907  ui_clip_request_data(uint32 format)
907                  return;                  return;
908          }          }
909    
910          primary_owner = XGetSelectionOwner(g_display, primary_atom);          if (auto_mode)
911                    primary_owner = XGetSelectionOwner(g_display, primary_atom);
912            else
913                    primary_owner = None;
914    
915          clipboard_owner = XGetSelectionOwner(g_display, clipboard_atom);          clipboard_owner = XGetSelectionOwner(g_display, clipboard_atom);
916    
917          /* Both available */          /* Both available */
# Line 943  ui_clip_sync(void) Line 952  ui_clip_sync(void)
952          cliprdr_send_simple_native_format_announce(RDP_CF_TEXT);          cliprdr_send_simple_native_format_announce(RDP_CF_TEXT);
953  }  }
954    
955    void
956    ui_clip_set_mode(const char *optarg)
957    {
958            g_rdpclip = True;
959    
960            if (str_startswith(optarg, "auto") || str_startswith(optarg, "on")
961                || str_startswith(optarg, "PRIMARYCLIPBOARD"))
962                    auto_mode = True;
963            else if (str_startswith(optarg, "CLIPBOARD"))
964                    auto_mode = False;
965            else
966            {
967                    warning("Invalid clipboard mode '%s'.\n", optarg);
968                    g_rdpclip = False;
969            }
970    }
971    
972  void  void
973  xclip_init(void)  xclip_init(void)
974  {  {
975            if (!g_rdpclip)
976                    return;
977    
978          if (!cliprdr_init())          if (!cliprdr_init())
979                  return;                  return;
980    

Legend:
Removed from v.1206  
changed lines
  Added in v.1207

  ViewVC Help
Powered by ViewVC 1.1.26