diff options
| author | Gerd Moellmann | 1999-09-13 11:14:26 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-09-13 11:14:26 +0000 |
| commit | 378c33ca4bc79a4645f9e3296c5f18b96e6e3ee1 (patch) | |
| tree | e98ff710aab079de31f5499dbeeba72bb7fdd6ab /src | |
| parent | b404828f5f995bacec87cc75391d79eb60edede1 (diff) | |
| download | emacs-378c33ca4bc79a4645f9e3296c5f18b96e6e3ee1.tar.gz emacs-378c33ca4bc79a4645f9e3296c5f18b96e6e3ee1.zip | |
(x_own_selection): Change for Lisp_Object selected_frame.
(Fx_store_cut_buffer_internal): Ditto.
(Fx_rotate_cut_buffers_internal): Ditto.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xselect.c | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/src/xselect.c b/src/xselect.c index ba7b7063f9c..7057e234007 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -239,11 +239,12 @@ static void | |||
| 239 | x_own_selection (selection_name, selection_value) | 239 | x_own_selection (selection_name, selection_value) |
| 240 | Lisp_Object selection_name, selection_value; | 240 | Lisp_Object selection_name, selection_value; |
| 241 | { | 241 | { |
| 242 | Window selecting_window = FRAME_X_WINDOW (selected_frame); | 242 | struct frame *sf = SELECTED_FRAME (); |
| 243 | Display *display = FRAME_X_DISPLAY (selected_frame); | 243 | Window selecting_window = FRAME_X_WINDOW (sf); |
| 244 | Display *display = FRAME_X_DISPLAY (sf); | ||
| 244 | Time time = last_event_timestamp; | 245 | Time time = last_event_timestamp; |
| 245 | Atom selection_atom; | 246 | Atom selection_atom; |
| 246 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame); | 247 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf); |
| 247 | int count; | 248 | int count; |
| 248 | 249 | ||
| 249 | CHECK_SYMBOL (selection_name, 0); | 250 | CHECK_SYMBOL (selection_name, 0); |
| @@ -266,7 +267,7 @@ x_own_selection (selection_name, selection_value) | |||
| 266 | selection_data = Fcons (selection_name, | 267 | selection_data = Fcons (selection_name, |
| 267 | Fcons (selection_value, | 268 | Fcons (selection_value, |
| 268 | Fcons (selection_time, | 269 | Fcons (selection_time, |
| 269 | Fcons (Fselected_frame (), Qnil)))); | 270 | Fcons (selected_frame, Qnil)))); |
| 270 | prev_value = assq_no_quit (selection_name, Vselection_alist); | 271 | prev_value = assq_no_quit (selection_name, Vselection_alist); |
| 271 | 272 | ||
| 272 | Vselection_alist = Fcons (selection_data, Vselection_alist); | 273 | Vselection_alist = Fcons (selection_data, Vselection_alist); |
| @@ -1128,9 +1129,10 @@ static Lisp_Object | |||
| 1128 | x_get_foreign_selection (selection_symbol, target_type) | 1129 | x_get_foreign_selection (selection_symbol, target_type) |
| 1129 | Lisp_Object selection_symbol, target_type; | 1130 | Lisp_Object selection_symbol, target_type; |
| 1130 | { | 1131 | { |
| 1131 | Window requestor_window = FRAME_X_WINDOW (selected_frame); | 1132 | struct frame *sf = SELECTED_FRAME (); |
| 1132 | Display *display = FRAME_X_DISPLAY (selected_frame); | 1133 | Window requestor_window = FRAME_X_WINDOW (sf); |
| 1133 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame); | 1134 | Display *display = FRAME_X_DISPLAY (sf); |
| 1135 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf); | ||
| 1134 | Time requestor_time = last_event_timestamp; | 1136 | Time requestor_time = last_event_timestamp; |
| 1135 | Atom target_property = dpyinfo->Xatom_EMACS_TMP; | 1137 | Atom target_property = dpyinfo->Xatom_EMACS_TMP; |
| 1136 | Atom selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol); | 1138 | Atom selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol); |
| @@ -1964,10 +1966,11 @@ Disowning it means there is no such selection.") | |||
| 1964 | struct selection_input_event event; | 1966 | struct selection_input_event event; |
| 1965 | Display *display; | 1967 | Display *display; |
| 1966 | struct x_display_info *dpyinfo; | 1968 | struct x_display_info *dpyinfo; |
| 1969 | struct frame *sf = SELECTED_FRAME (); | ||
| 1967 | 1970 | ||
| 1968 | check_x (); | 1971 | check_x (); |
| 1969 | display = FRAME_X_DISPLAY (selected_frame); | 1972 | display = FRAME_X_DISPLAY (sf); |
| 1970 | dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame); | 1973 | dpyinfo = FRAME_X_DISPLAY_INFO (sf); |
| 1971 | CHECK_SYMBOL (selection, 0); | 1974 | CHECK_SYMBOL (selection, 0); |
| 1972 | if (NILP (time)) | 1975 | if (NILP (time)) |
| 1973 | timestamp = last_event_timestamp; | 1976 | timestamp = last_event_timestamp; |
| @@ -2052,19 +2055,19 @@ and t is the same as `SECONDARY'.)") | |||
| 2052 | Window owner; | 2055 | Window owner; |
| 2053 | Atom atom; | 2056 | Atom atom; |
| 2054 | Display *dpy; | 2057 | Display *dpy; |
| 2058 | struct frame *sf = SELECTED_FRAME (); | ||
| 2055 | 2059 | ||
| 2056 | /* It should be safe to call this before we have an X frame. */ | 2060 | /* It should be safe to call this before we have an X frame. */ |
| 2057 | if (! FRAME_X_P (selected_frame)) | 2061 | if (! FRAME_X_P (sf)) |
| 2058 | return Qnil; | 2062 | return Qnil; |
| 2059 | 2063 | ||
| 2060 | dpy = FRAME_X_DISPLAY (selected_frame); | 2064 | dpy = FRAME_X_DISPLAY (sf); |
| 2061 | CHECK_SYMBOL (selection, 0); | 2065 | CHECK_SYMBOL (selection, 0); |
| 2062 | if (!NILP (Fx_selection_owner_p (selection))) | 2066 | if (!NILP (Fx_selection_owner_p (selection))) |
| 2063 | return Qt; | 2067 | return Qt; |
| 2064 | if (EQ (selection, Qnil)) selection = QPRIMARY; | 2068 | if (EQ (selection, Qnil)) selection = QPRIMARY; |
| 2065 | if (EQ (selection, Qt)) selection = QSECONDARY; | 2069 | if (EQ (selection, Qt)) selection = QSECONDARY; |
| 2066 | atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (selected_frame), | 2070 | atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf), dpy, selection); |
| 2067 | dpy, selection); | ||
| 2068 | if (atom == 0) | 2071 | if (atom == 0) |
| 2069 | return Qnil; | 2072 | return Qnil; |
| 2070 | BLOCK_INPUT; | 2073 | BLOCK_INPUT; |
| @@ -2126,10 +2129,11 @@ DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal, | |||
| 2126 | Lisp_Object ret; | 2129 | Lisp_Object ret; |
| 2127 | Display *display; | 2130 | Display *display; |
| 2128 | struct x_display_info *dpyinfo; | 2131 | struct x_display_info *dpyinfo; |
| 2132 | struct frame *sf = SELECTED_FRAME (); | ||
| 2129 | 2133 | ||
| 2130 | check_x (); | 2134 | check_x (); |
| 2131 | display = FRAME_X_DISPLAY (selected_frame); | 2135 | display = FRAME_X_DISPLAY (sf); |
| 2132 | dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame); | 2136 | dpyinfo = FRAME_X_DISPLAY_INFO (sf); |
| 2133 | window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ | 2137 | window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ |
| 2134 | CHECK_CUT_BUFFER (buffer, 0); | 2138 | CHECK_CUT_BUFFER (buffer, 0); |
| 2135 | buffer_atom = symbol_to_x_atom (dpyinfo, display, buffer); | 2139 | buffer_atom = symbol_to_x_atom (dpyinfo, display, buffer); |
| @@ -2166,9 +2170,10 @@ DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal, | |||
| 2166 | int bytes_remaining; | 2170 | int bytes_remaining; |
| 2167 | int max_bytes; | 2171 | int max_bytes; |
| 2168 | Display *display; | 2172 | Display *display; |
| 2173 | struct frame *sf = SELECTED_FRAME (); | ||
| 2169 | 2174 | ||
| 2170 | check_x (); | 2175 | check_x (); |
| 2171 | display = FRAME_X_DISPLAY (selected_frame); | 2176 | display = FRAME_X_DISPLAY (sf); |
| 2172 | window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ | 2177 | window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ |
| 2173 | 2178 | ||
| 2174 | max_bytes = SELECTION_QUANTUM (display); | 2179 | max_bytes = SELECTION_QUANTUM (display); |
| @@ -2177,16 +2182,16 @@ DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal, | |||
| 2177 | 2182 | ||
| 2178 | CHECK_CUT_BUFFER (buffer, 0); | 2183 | CHECK_CUT_BUFFER (buffer, 0); |
| 2179 | CHECK_STRING (string, 0); | 2184 | CHECK_STRING (string, 0); |
| 2180 | buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (selected_frame), | 2185 | buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf), |
| 2181 | display, buffer); | 2186 | display, buffer); |
| 2182 | data = (unsigned char *) XSTRING (string)->data; | 2187 | data = (unsigned char *) XSTRING (string)->data; |
| 2183 | bytes = STRING_BYTES (XSTRING (string)); | 2188 | bytes = STRING_BYTES (XSTRING (string)); |
| 2184 | bytes_remaining = bytes; | 2189 | bytes_remaining = bytes; |
| 2185 | 2190 | ||
| 2186 | if (! FRAME_X_DISPLAY_INFO (selected_frame)->cut_buffers_initialized) | 2191 | if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized) |
| 2187 | { | 2192 | { |
| 2188 | initialize_cut_buffers (display, window); | 2193 | initialize_cut_buffers (display, window); |
| 2189 | FRAME_X_DISPLAY_INFO (selected_frame)->cut_buffers_initialized = 1; | 2194 | FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized = 1; |
| 2190 | } | 2195 | } |
| 2191 | 2196 | ||
| 2192 | BLOCK_INPUT; | 2197 | BLOCK_INPUT; |
| @@ -2223,17 +2228,18 @@ Positive means shift the values forward, negative means backward.") | |||
| 2223 | Window window; | 2228 | Window window; |
| 2224 | Atom props[8]; | 2229 | Atom props[8]; |
| 2225 | Display *display; | 2230 | Display *display; |
| 2231 | struct frame *sf = SELECTED_FRAME (); | ||
| 2226 | 2232 | ||
| 2227 | check_x (); | 2233 | check_x (); |
| 2228 | display = FRAME_X_DISPLAY (selected_frame); | 2234 | display = FRAME_X_DISPLAY (sf); |
| 2229 | window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ | 2235 | window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ |
| 2230 | CHECK_NUMBER (n, 0); | 2236 | CHECK_NUMBER (n, 0); |
| 2231 | if (XINT (n) == 0) | 2237 | if (XINT (n) == 0) |
| 2232 | return n; | 2238 | return n; |
| 2233 | if (! FRAME_X_DISPLAY_INFO (selected_frame)->cut_buffers_initialized) | 2239 | if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized) |
| 2234 | { | 2240 | { |
| 2235 | initialize_cut_buffers (display, window); | 2241 | initialize_cut_buffers (display, window); |
| 2236 | FRAME_X_DISPLAY_INFO (selected_frame)->cut_buffers_initialized = 1; | 2242 | FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized = 1; |
| 2237 | } | 2243 | } |
| 2238 | 2244 | ||
| 2239 | props[0] = XA_CUT_BUFFER0; | 2245 | props[0] = XA_CUT_BUFFER0; |