aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xselect.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/xselect.c b/src/xselect.c
index d0673d8b70e..520be0cda80 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -54,7 +54,9 @@ static struct prop_location *expect_property_change P_ ((Display *, Window,
54static void unexpect_property_change P_ ((struct prop_location *)); 54static void unexpect_property_change P_ ((struct prop_location *));
55static Lisp_Object wait_for_property_change_unwind P_ ((Lisp_Object)); 55static Lisp_Object wait_for_property_change_unwind P_ ((Lisp_Object));
56static void wait_for_property_change P_ ((struct prop_location *)); 56static void wait_for_property_change P_ ((struct prop_location *));
57static Lisp_Object x_get_foreign_selection P_ ((Lisp_Object, Lisp_Object)); 57static Lisp_Object x_get_foreign_selection P_ ((Lisp_Object,
58 Lisp_Object,
59 Lisp_Object));
58static void x_get_window_property P_ ((Display *, Window, Atom, 60static void x_get_window_property P_ ((Display *, Window, Atom,
59 unsigned char **, int *, 61 unsigned char **, int *,
60 Atom *, int *, unsigned long *, int)); 62 Atom *, int *, unsigned long *, int));
@@ -1219,8 +1221,8 @@ static Window reading_selection_window;
1219 Converts this to Lisp data and returns it. */ 1221 Converts this to Lisp data and returns it. */
1220 1222
1221static Lisp_Object 1223static Lisp_Object
1222x_get_foreign_selection (selection_symbol, target_type) 1224x_get_foreign_selection (selection_symbol, target_type, time_stamp)
1223 Lisp_Object selection_symbol, target_type; 1225 Lisp_Object selection_symbol, target_type, time_stamp;
1224{ 1226{
1225 struct frame *sf = SELECTED_FRAME (); 1227 struct frame *sf = SELECTED_FRAME ();
1226 Window requestor_window = FRAME_X_WINDOW (sf); 1228 Window requestor_window = FRAME_X_WINDOW (sf);
@@ -1239,6 +1241,18 @@ x_get_foreign_selection (selection_symbol, target_type)
1239 else 1241 else
1240 type_atom = symbol_to_x_atom (dpyinfo, display, target_type); 1242 type_atom = symbol_to_x_atom (dpyinfo, display, target_type);
1241 1243
1244 if (! NILP (time_stamp))
1245 {
1246 if (CONSP (time_stamp))
1247 requestor_time = (Time) cons_to_long (time_stamp);
1248 else if (INTEGERP (time_stamp))
1249 requestor_time = (Time) XUINT (time_stamp);
1250 else if (FLOATP (time_stamp))
1251 requestor_time = (Time) XFLOAT (time_stamp);
1252 else
1253 error ("TIME_STAMP must be cons or number");
1254 }
1255
1242 BLOCK_INPUT; 1256 BLOCK_INPUT;
1243 1257
1244 count = x_catch_errors (display); 1258 count = x_catch_errors (display);
@@ -1930,13 +1944,15 @@ anything that the functions on `selection-converter-alist' know about. */)
1930 will block until all of the data has arrived. */ 1944 will block until all of the data has arrived. */
1931 1945
1932DEFUN ("x-get-selection-internal", Fx_get_selection_internal, 1946DEFUN ("x-get-selection-internal", Fx_get_selection_internal,
1933 Sx_get_selection_internal, 2, 2, 0, 1947 Sx_get_selection_internal, 2, 3, 0,
1934 doc: /* Return text selected from some X window. 1948 doc: /* Return text selected from some X window.
1935SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. 1949SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
1936\(Those are literal upper-case symbol names, since that's what X expects.) 1950\(Those are literal upper-case symbol names, since that's what X expects.)
1937TYPE is the type of data desired, typically `STRING'. */) 1951TYPE is the type of data desired, typically `STRING'.
1938 (selection_symbol, target_type) 1952TIME_STAMP is the time to use in the XConvertSelection call for foreign
1939 Lisp_Object selection_symbol, target_type; 1953selections. If omitted, defaults to the time for the last event. */)
1954 (selection_symbol, target_type, time_stamp)
1955 Lisp_Object selection_symbol, target_type, time_stamp;
1940{ 1956{
1941 Lisp_Object val = Qnil; 1957 Lisp_Object val = Qnil;
1942 struct gcpro gcpro1, gcpro2; 1958 struct gcpro gcpro1, gcpro2;
@@ -1960,7 +1976,7 @@ TYPE is the type of data desired, typically `STRING'. */)
1960 1976
1961 if (NILP (val)) 1977 if (NILP (val))
1962 { 1978 {
1963 val = x_get_foreign_selection (selection_symbol, target_type); 1979 val = x_get_foreign_selection (selection_symbol, target_type, time_stamp);
1964 goto DONE; 1980 goto DONE;
1965 } 1981 }
1966 1982