diff src/macterm.c @ 56271:98f2b9da67f0

macterm.c (XTread_socket): Correctly set the frame position after the window is moved.
author Steven Tamm <steventamm@mac.com>
date Mon, 28 Jun 2004 16:20:41 +0000
parents 5e784b2ea638
children fd126130c3cd
line wrap: on
line diff
--- a/src/macterm.c	Mon Jun 28 14:40:42 2004 +0000
+++ b/src/macterm.c	Mon Jun 28 16:20:41 2004 +0000
@@ -8084,6 +8084,25 @@
       if (!mac_convert_event_ref (eventRef, &er))
 	switch (GetEventClass (eventRef))
 	  {
+	  case kEventClassWindow:
+	    if (GetEventKind (eventRef) == kEventWindowBoundsChanged) 
+	      {
+		WindowPtr window_ptr;
+		GetEventParameter(eventRef, kEventParamDirectObject,
+				  typeWindowRef, NULL, sizeof(WindowPtr),
+				  NULL, &window_ptr);
+		f = mac_window_to_frame (window_ptr);
+		if (f && !f->async_iconified)
+		  {
+		    int x, y;
+		    
+		    x_real_positions (f, &x, &y);
+		    f->left_pos = x;
+		    f->top_pos = y;
+		  }
+		SendEventToEventTarget (eventRef, toolbox_dispatcher);
+	      }
+	    break;
 	  case kEventClassMouse:
 	    if (GetEventKind (eventRef) == kEventMouseWheelMoved)
 	      {
@@ -8306,6 +8325,18 @@
 #else /* not TARGET_API_MAC_CARBON */
 		DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
 #endif /* not TARGET_API_MAC_CARBON */
+		/* Update the frame parameters.  */
+		{
+		  struct frame *f = mac_window_to_frame (window_ptr);
+		  if (f && !f->async_iconified)
+		    {
+		      int x, y;
+		      
+		      x_real_positions (f, &x, &y);
+		      f->left_pos = x;
+		      f->top_pos = y;
+		    }
+		}
 		break;
 
 	      case inGoAway: