changeset 46805:0139d2dce230

2002-08-04 Andrew Choi <akochoi@shaw.ca> * macterm.c (XTread_socket): Check that FrontNonFloatingWindow returns a valid window pointer before proceeding for keyDown and autoKey events.
author Andrew Choi <akochoi@shaw.ca>
date Sun, 04 Aug 2002 19:29:06 +0000
parents d729c9804513
children 84c5e0fe2291
files src/ChangeLog src/macterm.c
diffstat 2 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sun Aug 04 16:18:54 2002 +0000
+++ b/src/ChangeLog	Sun Aug 04 19:29:06 2002 +0000
@@ -1,3 +1,9 @@
+2002-08-04  Andrew Choi  <akochoi@shaw.ca>
+
+	* macterm.c (XTread_socket): Check that FrontNonFloatingWindow
+	returns a valid window pointer before proceeding for keyDown and
+	autoKey events.
+
 2002-08-03  Andrew Choi  <akochoi@shaw.ca>
 
 	* macterm.c (USE_CARBON_EVENTS): New macro.
--- a/src/macterm.c	Sun Aug 04 16:18:54 2002 +0000
+++ b/src/macterm.c	Sun Aug 04 19:29:06 2002 +0000
@@ -12610,7 +12610,9 @@
 
 #if USE_CARBON_EVENTS
   rneResult = ReceiveNextEvent (0, NULL, 
-				expected ? TicksToEventTime(app_sleep_time) : 0,
+				expected
+				? TicksToEventTime (app_sleep_time)
+				: 0,
 				true, &eventRef);
   if (!rneResult)
     {
@@ -12869,6 +12871,13 @@
 	  int keycode = (er.message & keyCodeMask) >> 8;
 	  int xkeysym;
 	  
+	  if (!IsValidWindowPtr (FrontNonFloatingWindow ()))
+	    {
+	      SysBeep (1);
+	      UNBLOCK_INPUT;
+	      return 0;
+	    }
+
 	  ObscureCursor ();
 
 	  if (keycode == 0x33)  /* delete key (charCode translated to 0x8) */