diff src/event-stream.c @ 72:b9518feda344 r20-0b31

Import from CVS: tag r20-0b31
author cvs
date Mon, 13 Aug 2007 09:03:46 +0200
parents 131b0175ea99
children 54cc21c15cbb
line wrap: on
line diff
--- a/src/event-stream.c	Mon Aug 13 09:03:07 2007 +0200
+++ b/src/event-stream.c	Mon Aug 13 09:03:46 2007 +0200
@@ -78,6 +78,9 @@
 /* Hook run when XEmacs is about to be idle. */
 Lisp_Object Qpre_idle_hook, Vpre_idle_hook;
 
+/* Control gratuitous keyboard focus throwing. */
+int focus_follows_mouse;
+
 #ifdef ILL_CONCEIVED_HOOK
 /* Hook run after a command if there's no more input soon.  */
 Lisp_Object Qpost_command_idle_hook, Vpost_command_idle_hook;
@@ -1638,6 +1641,7 @@
 	 in emacs_handle_focus_change_final() is based on the _FOR_HOOKS
 	 value, we need to do so too. */
       if (!NILP (sel_frame) &&
+	  !focus_follows_mouse &&
 	  !EQ (DEVICE_FRAME_THAT_OUGHT_TO_HAVE_FOCUS (d), sel_frame) &&
 	  !NILP (DEVICE_FRAME_WITH_FOCUS_FOR_HOOKS (d)) &&
 	  !EQ (DEVICE_FRAME_WITH_FOCUS_FOR_HOOKS (d), sel_frame))
@@ -4165,6 +4169,13 @@
 */ );
   Vpre_idle_hook = Qnil;
 
+  DEFVAR_BOOL ("focus-follows-mouse", &focus_follows_mouse /*
+Variable to control XEmacs behavior with respect to focus changing.
+If this variable is set to t, then XEmacs will not gratuitously change
+the keyboard focus.
+*/ );
+  focus_follows_mouse = 0;
+
 #ifdef ILL_CONCEIVED_HOOK
   /* Ill-conceived because it's not run in all sorts of cases
      where XEmacs is blocking.  That's what `pre-idle-hook'