changeset 2195:b20bb441f47f

(Xatom_wm_change_state): Define here. (XTread_socket): Handle NEW_SELECTIONS alternative: queue events for SelectionRequest and SelectionClear; call functions for SelectionNotify and PropertyNotify.
author Richard M. Stallman <rms@gnu.org>
date Mon, 15 Mar 1993 06:04:31 +0000
parents 886a69457557
children 75e1f1ee83ad
files src/xterm.c
diffstat 1 files changed, 59 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Mon Mar 15 06:03:33 1993 +0000
+++ b/src/xterm.c	Mon Mar 15 06:04:31 1993 +0000
@@ -25,6 +25,8 @@
    
 */
 
+#define NEW_SELECTIONS
+
 #include "config.h"
 
 #ifdef HAVE_X_WINDOWS
@@ -2441,6 +2443,9 @@
 Atom Xatom_wm_configure_denied;	  /* When our config request is denied */
 Atom Xatom_wm_window_moved;	  /* When the WM moves us. */
 
+/* Window manager communication.  */
+Atom Xatom_wm_change_state;
+
 /* Record the last 100 characters stored
    to help debug the loss-of-chars-during-GC problem.  */
 int temp_index;
@@ -2562,18 +2567,65 @@
 	  }
 	  break;
 
+#ifdef NEW_SELECTIONS
+	case SelectionNotify:
+	  x_handle_selection_notify (&event);
+	  break;
+#endif
+
 	case SelectionClear:	/* Someone has grabbed ownership. */
+#ifdef NEW_SELECTIONS
+	  {
+	    XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event;
+
+	    if (numchars == 0)
+	      abort ();
+
+	    bufp->kind = selection_clear_event;
+	    SELECTION_EVENT_DISPLAY (bufp) = eventp->display;
+	    SELECTION_EVENT_SELECTION (bufp) = eventp->selection;
+	    SELECTION_EVENT_TIME (bufp) = eventp->time;
+	    bufp++;
+
+	    count += 1;
+	    numchars -= 1;
+	  }
+#else
 	  x_disown_selection (event.xselectionclear.window,
 			      event.xselectionclear.selection,
 			      event.xselectionclear.time);
+#endif
 	  break;
 
 	case SelectionRequest:	/* Someone wants our selection. */
+#ifdef NEW_SELECTIONS
+	  {
+	    XSelectionRequestEvent *eventp = (XSelectionRequestEvent *) &event;
+
+	    if (numchars == 0)
+	      abort ();
+
+	    bufp->kind = selection_request_event;
+	    SELECTION_EVENT_DISPLAY (bufp) = eventp->display;
+	    SELECTION_EVENT_REQUESTOR (bufp) = eventp->requestor;
+	    SELECTION_EVENT_SELECTION (bufp) = eventp->selection;
+	    SELECTION_EVENT_TARGET (bufp) = eventp->target;
+	    SELECTION_EVENT_PROPERTY (bufp) = eventp->property;
+	    SELECTION_EVENT_TIME (bufp) = eventp->time;
+	    bufp++;
+
+	    count += 1;
+	    numchars -= 1;
+	  }
+#else
 	  x_answer_selection_request (event);
+#endif
 	  break;
 
 	case PropertyNotify:
-
+#ifdef NEW_SELECTIONS
+	  x_handle_property_notify (&event);
+#else
 	  /* If we're being told about a root window property, then it's
 	     a cut buffer change.  */
 	  if (event.xproperty.window == ROOT_WINDOW)
@@ -2587,6 +2639,7 @@
 		 about re-selecting. */
 	      x_send_incremental (event);
 	    }
+#endif
 	  break;
 
 	case Expose:
@@ -4155,9 +4208,6 @@
   UNBLOCK_INPUT;
 }
 
-/* Window manager communication.  Created in Fx_open_connection. */
-extern Atom Xatom_wm_change_state;
-
 /* Change window state from mapped to iconified. */
 
 x_iconify_frame (f)
@@ -4495,12 +4545,14 @@
   x_find_modifier_meanings ();
 
   /* Get the scroll bar cursor.  */
-  x_vertical_scroll_bar_cursor =
-    XCreateFontCursor (x_current_display, XC_sb_v_double_arrow);
-
+  x_vertical_scroll_bar_cursor
+    = XCreateFontCursor (x_current_display, XC_sb_v_double_arrow);
+
+#if 0
   /* Watch for PropertyNotify events on the root window; we use them
      to figure out when to invalidate our cache of the cut buffers.  */
   x_watch_cut_buffer_cache ();
+#endif
 
   dup2 (ConnectionNumber (x_current_display), 0);