Karsten Hopp 0826df
To: vim_dev@googlegroups.com
Karsten Hopp 0826df
Subject: Patch 7.4.808
Karsten Hopp 0826df
Fcc: outbox
Karsten Hopp 0826df
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 0826df
Mime-Version: 1.0
Karsten Hopp 0826df
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 0826df
Content-Transfer-Encoding: 8bit
Karsten Hopp 0826df
------------
Karsten Hopp 0826df
Karsten Hopp 0826df
Patch 7.4.808
Karsten Hopp 0826df
Problem:    On MS-Windows 10 IME input doen't work correctly.
Karsten Hopp 0826df
Solution:   Read console input before calling MsgWaitForMultipleObjects().
Karsten Hopp 0826df
            (vim-jp, Nobuhiro Takasaki)
Karsten Hopp 0826df
Files:      src/os_win32.c
Karsten Hopp 0826df
Karsten Hopp 0826df
Karsten Hopp 0826df
*** ../vim-7.4.807/src/os_win32.c	2015-07-17 14:16:49.854596682 +0200
Karsten Hopp 0826df
--- src/os_win32.c	2015-08-04 19:23:17.165798107 +0200
Karsten Hopp 0826df
***************
Karsten Hopp 0826df
*** 259,264 ****
Karsten Hopp 0826df
--- 259,267 ----
Karsten Hopp 0826df
      int tail;
Karsten Hopp 0826df
      int i;
Karsten Hopp 0826df
  
Karsten Hopp 0826df
+     if (nLength == -2)
Karsten Hopp 0826df
+ 	return (s_dwMax > 0) ? TRUE : FALSE;
Karsten Hopp 0826df
+ 
Karsten Hopp 0826df
      if (!win8_or_later)
Karsten Hopp 0826df
      {
Karsten Hopp 0826df
  	if (nLength == -1)
Karsten Hopp 0826df
***************
Karsten Hopp 0826df
*** 303,309 ****
Karsten Hopp 0826df
      }
Karsten Hopp 0826df
  
Karsten Hopp 0826df
      *lpBuffer = s_irCache[s_dwIndex];
Karsten Hopp 0826df
!     if (nLength != -1 && ++s_dwIndex >= s_dwMax)
Karsten Hopp 0826df
  	s_dwMax = 0;
Karsten Hopp 0826df
      *lpEvents = 1;
Karsten Hopp 0826df
      return TRUE;
Karsten Hopp 0826df
--- 306,312 ----
Karsten Hopp 0826df
      }
Karsten Hopp 0826df
  
Karsten Hopp 0826df
      *lpBuffer = s_irCache[s_dwIndex];
Karsten Hopp 0826df
!     if (!(nLength == -1 || nLength == -2) && ++s_dwIndex >= s_dwMax)
Karsten Hopp 0826df
  	s_dwMax = 0;
Karsten Hopp 0826df
      *lpEvents = 1;
Karsten Hopp 0826df
      return TRUE;
Karsten Hopp 0826df
***************
Karsten Hopp 0826df
*** 322,327 ****
Karsten Hopp 0826df
--- 325,354 ----
Karsten Hopp 0826df
      return read_console_input(hInput, lpBuffer, -1, lpEvents);
Karsten Hopp 0826df
  }
Karsten Hopp 0826df
  
Karsten Hopp 0826df
+     static DWORD
Karsten Hopp 0826df
+ msg_wait_for_multiple_objects(
Karsten Hopp 0826df
+     DWORD    nCount,
Karsten Hopp 0826df
+     LPHANDLE pHandles,
Karsten Hopp 0826df
+     BOOL     fWaitAll,
Karsten Hopp 0826df
+     DWORD    dwMilliseconds,
Karsten Hopp 0826df
+     DWORD    dwWakeMask)
Karsten Hopp 0826df
+ {
Karsten Hopp 0826df
+     if (read_console_input(NULL, NULL, -2, NULL))
Karsten Hopp 0826df
+ 	return WAIT_OBJECT_0;
Karsten Hopp 0826df
+     return MsgWaitForMultipleObjects(nCount, pHandles, fWaitAll,
Karsten Hopp 0826df
+ 				     dwMilliseconds, dwWakeMask);
Karsten Hopp 0826df
+ }
Karsten Hopp 0826df
+ 
Karsten Hopp 0826df
+     static DWORD
Karsten Hopp 0826df
+ wait_for_single_object(
Karsten Hopp 0826df
+     HANDLE hHandle,
Karsten Hopp 0826df
+     DWORD dwMilliseconds)
Karsten Hopp 0826df
+ {
Karsten Hopp 0826df
+     if (read_console_input(NULL, NULL, -2, NULL))
Karsten Hopp 0826df
+ 	return WAIT_OBJECT_0;
Karsten Hopp 0826df
+     return WaitForSingleObject(hHandle, dwMilliseconds);
Karsten Hopp 0826df
+ }
Karsten Hopp 0826df
+ 
Karsten Hopp 0826df
      static void
Karsten Hopp 0826df
  get_exe_name(void)
Karsten Hopp 0826df
  {
Karsten Hopp 0826df
***************
Karsten Hopp 0826df
*** 1459,1468 ****
Karsten Hopp 0826df
  #ifdef FEAT_CLIENTSERVER
Karsten Hopp 0826df
  	    /* Wait for either an event on the console input or a message in
Karsten Hopp 0826df
  	     * the client-server window. */
Karsten Hopp 0826df
! 	    if (MsgWaitForMultipleObjects(1, &g_hConIn, FALSE,
Karsten Hopp 0826df
  				 dwWaitTime, QS_SENDMESSAGE) != WAIT_OBJECT_0)
Karsten Hopp 0826df
  #else
Karsten Hopp 0826df
! 	    if (WaitForSingleObject(g_hConIn, dwWaitTime) != WAIT_OBJECT_0)
Karsten Hopp 0826df
  #endif
Karsten Hopp 0826df
  		    continue;
Karsten Hopp 0826df
  	}
Karsten Hopp 0826df
--- 1486,1495 ----
Karsten Hopp 0826df
  #ifdef FEAT_CLIENTSERVER
Karsten Hopp 0826df
  	    /* Wait for either an event on the console input or a message in
Karsten Hopp 0826df
  	     * the client-server window. */
Karsten Hopp 0826df
! 	    if (msg_wait_for_multiple_objects(1, &g_hConIn, FALSE,
Karsten Hopp 0826df
  				 dwWaitTime, QS_SENDMESSAGE) != WAIT_OBJECT_0)
Karsten Hopp 0826df
  #else
Karsten Hopp 0826df
! 	    if (wait_for_single_object(g_hConIn, dwWaitTime) != WAIT_OBJECT_0)
Karsten Hopp 0826df
  #endif
Karsten Hopp 0826df
  		    continue;
Karsten Hopp 0826df
  	}
Karsten Hopp 0826df
*** ../vim-7.4.807/src/version.c	2015-08-04 19:18:46.044825907 +0200
Karsten Hopp 0826df
--- src/version.c	2015-08-04 19:24:45.568810366 +0200
Karsten Hopp 0826df
***************
Karsten Hopp 0826df
*** 743,744 ****
Karsten Hopp 0826df
--- 743,746 ----
Karsten Hopp 0826df
  {   /* Add new patch number below this line */
Karsten Hopp 0826df
+ /**/
Karsten Hopp 0826df
+     808,
Karsten Hopp 0826df
  /**/
Karsten Hopp 0826df
Karsten Hopp 0826df
-- 
Karsten Hopp 0826df
Why doesn't Tarzan have a beard?
Karsten Hopp 0826df
Karsten Hopp 0826df
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 0826df
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 0826df
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 0826df
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///