changeset 25681:3e56c05edfab

(x_own_selection): Change for Lisp_Object selected_frame. (Fx_store_cut_buffer_internal): Ditto. (Fx_rotate_cut_buffers_internal): Ditto.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 13 Sep 1999 11:14:26 +0000
parents 841eb01263ef
children f8543a6d88ca
files src/xselect.c
diffstat 1 files changed, 28 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/xselect.c	Mon Sep 13 11:14:23 1999 +0000
+++ b/src/xselect.c	Mon Sep 13 11:14:26 1999 +0000
@@ -239,11 +239,12 @@
 x_own_selection (selection_name, selection_value)
      Lisp_Object selection_name, selection_value;
 {
-  Window selecting_window = FRAME_X_WINDOW (selected_frame);
-  Display *display = FRAME_X_DISPLAY (selected_frame);
+  struct frame *sf = SELECTED_FRAME ();
+  Window selecting_window = FRAME_X_WINDOW (sf);
+  Display *display = FRAME_X_DISPLAY (sf);
   Time time = last_event_timestamp;
   Atom selection_atom;
-  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame);
+  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf);
   int count;
 
   CHECK_SYMBOL (selection_name, 0);
@@ -266,7 +267,7 @@
     selection_data = Fcons (selection_name,
 			    Fcons (selection_value,
 				   Fcons (selection_time,
-					  Fcons (Fselected_frame (), Qnil))));
+					  Fcons (selected_frame, Qnil))));
     prev_value = assq_no_quit (selection_name, Vselection_alist);
 
     Vselection_alist = Fcons (selection_data, Vselection_alist);
@@ -1128,9 +1129,10 @@
 x_get_foreign_selection (selection_symbol, target_type)
      Lisp_Object selection_symbol, target_type;
 {
-  Window requestor_window = FRAME_X_WINDOW (selected_frame);
-  Display *display = FRAME_X_DISPLAY (selected_frame);
-  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame);
+  struct frame *sf = SELECTED_FRAME ();
+  Window requestor_window = FRAME_X_WINDOW (sf);
+  Display *display = FRAME_X_DISPLAY (sf);
+  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf);
   Time requestor_time = last_event_timestamp;
   Atom target_property = dpyinfo->Xatom_EMACS_TMP;
   Atom selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol);
@@ -1964,10 +1966,11 @@
   struct selection_input_event event;
   Display *display;
   struct x_display_info *dpyinfo;
+  struct frame *sf = SELECTED_FRAME ();
 
   check_x ();
-  display = FRAME_X_DISPLAY (selected_frame);
-  dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame);
+  display = FRAME_X_DISPLAY (sf);
+  dpyinfo = FRAME_X_DISPLAY_INFO (sf);
   CHECK_SYMBOL (selection, 0);
   if (NILP (time))
     timestamp = last_event_timestamp;
@@ -2052,19 +2055,19 @@
   Window owner;
   Atom atom;
   Display *dpy;
+  struct frame *sf = SELECTED_FRAME ();
 
   /* It should be safe to call this before we have an X frame.  */
-  if (! FRAME_X_P (selected_frame))
+  if (! FRAME_X_P (sf))
     return Qnil;
 
-  dpy = FRAME_X_DISPLAY (selected_frame);
+  dpy = FRAME_X_DISPLAY (sf);
   CHECK_SYMBOL (selection, 0);
   if (!NILP (Fx_selection_owner_p (selection)))
     return Qt;
   if (EQ (selection, Qnil)) selection = QPRIMARY;
   if (EQ (selection, Qt)) selection = QSECONDARY;
-  atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (selected_frame),
-			   dpy, selection);
+  atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf), dpy, selection);
   if (atom == 0)
     return Qnil;
   BLOCK_INPUT;
@@ -2126,10 +2129,11 @@
   Lisp_Object ret;
   Display *display;
   struct x_display_info *dpyinfo;
+  struct frame *sf = SELECTED_FRAME ();
 
   check_x ();
-  display = FRAME_X_DISPLAY (selected_frame);
-  dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame);
+  display = FRAME_X_DISPLAY (sf);
+  dpyinfo = FRAME_X_DISPLAY_INFO (sf);
   window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
   CHECK_CUT_BUFFER (buffer, 0);
   buffer_atom = symbol_to_x_atom (dpyinfo, display, buffer);
@@ -2166,9 +2170,10 @@
   int bytes_remaining;
   int max_bytes;
   Display *display;
+  struct frame *sf = SELECTED_FRAME ();
 
   check_x ();
-  display = FRAME_X_DISPLAY (selected_frame);
+  display = FRAME_X_DISPLAY (sf);
   window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
 
   max_bytes = SELECTION_QUANTUM (display);
@@ -2177,16 +2182,16 @@
 
   CHECK_CUT_BUFFER (buffer, 0);
   CHECK_STRING (string, 0);
-  buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (selected_frame),
+  buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf),
 				  display, buffer);
   data = (unsigned char *) XSTRING (string)->data;
   bytes = STRING_BYTES (XSTRING (string));
   bytes_remaining = bytes;
 
-  if (! FRAME_X_DISPLAY_INFO (selected_frame)->cut_buffers_initialized)
+  if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized)
     {
       initialize_cut_buffers (display, window);
-      FRAME_X_DISPLAY_INFO (selected_frame)->cut_buffers_initialized = 1;
+      FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized = 1;
     }
 
   BLOCK_INPUT;
@@ -2223,17 +2228,18 @@
   Window window;
   Atom props[8];
   Display *display;
+  struct frame *sf = SELECTED_FRAME ();
 
   check_x ();
-  display = FRAME_X_DISPLAY (selected_frame);
+  display = FRAME_X_DISPLAY (sf);
   window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
   CHECK_NUMBER (n, 0);
   if (XINT (n) == 0)
     return n;
-  if (! FRAME_X_DISPLAY_INFO (selected_frame)->cut_buffers_initialized)
+  if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized)
     {
       initialize_cut_buffers (display, window);
-      FRAME_X_DISPLAY_INFO (selected_frame)->cut_buffers_initialized = 1;
+      FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized = 1;
     }
 
   props[0] = XA_CUT_BUFFER0;