changeset 21740:92c501ecca49

(w32_read_socket): Don't misinterpret WM_PAINT message as an expose event if the repaint region is actually empty. Also use the standard menubar_selection_callback routine.
author Geoff Voelker <voelker@cs.washington.edu>
date Thu, 23 Apr 1998 23:42:28 +0000
parents e02be2b47d18
children 3d1ce72aa7b9
files src/w32term.c
diffstat 1 files changed, 15 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32term.c	Thu Apr 23 23:42:09 1998 +0000
+++ b/src/w32term.c	Thu Apr 23 23:42:28 1998 +0000
@@ -2772,14 +2772,22 @@
 
 	    if (f) 
 	      {
-	      if (f->async_visible != 1)
+		if (msg.rect.right == msg.rect.left ||
+		    msg.rect.bottom == msg.rect.top)
 		  {
-		  /* Definitely not obscured, so mark as visible.  */
+		    /* We may get paint messages even though the client
+		       area is clipped - these are not expose events. */
+		    DebPrint (("clipped frame %04x (%s) got WM_PAINT\n", f,
+			       XSTRING (f->name)->data));
+		  }
+		else if (f->async_visible != 1)
+		  {
+		    /* Definitely not obscured, so mark as visible.  */
 		    f->async_visible = 1;
 		    f->async_iconified = 0;
 		    SET_FRAME_GARBAGED (f);
-		  DebPrint (("frame %04x (%s) reexposed\n", f,
-			     XSTRING (f->name)->data));
+		    DebPrint (("frame %04x (%s) reexposed\n", f,
+			       XSTRING (f->name)->data));
 
 		    /* WM_PAINT serves as MapNotify as well, so report
                        visibility changes properly.  */
@@ -3144,45 +3152,12 @@
 
 	case WM_COMMAND:
 	  f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
-	  
-#if 1
+
 	  if (f)
 	    {
-	      if (msg.msg.lParam == 0) 
-		{
-		  /* Came from window menu */
-		  
-		  extern Lisp_Object get_frame_menubar_event ();
-		  Lisp_Object event = get_frame_menubar_event (f, msg.msg.wParam);
-		  struct input_event buf;
-		  Lisp_Object frame;
-		  
-		  XSETFRAME (frame, f);
-		  buf.kind = menu_bar_event;
-		  
-		  /* Store initial menu bar event */
-		  
-		  if (!NILP (event))
-		    {
-		      buf.frame_or_window = Fcons (frame, Fcons (Qmenu_bar, Qnil));
-		      kbd_buffer_store_event (&buf);
-		    }
-		  
-		  /* Enqueue the events */
-		  
-		  while (!NILP (event))
-		    {
-		      buf.frame_or_window = Fcons (frame, XCONS (event)->car);
-		      kbd_buffer_store_event (&buf);
-		      event = XCONS (event)->cdr;
-		    }
-		} 
-	      else 
-		{
-		  /* Came from popup menu */
-		}
+	      extern void menubar_selection_callback (FRAME_PTR f, void * client_data);
+	      menubar_selection_callback (f, (void *)msg.msg.wParam);
 	    }
-#endif
 
 	  check_visibility = 1;
 	  break;
@@ -4523,4 +4498,3 @@
 interpreted normally."); 
   Vw32_recognize_altgr = Qt;
 }
-