mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-10-26 12:27:44 +00:00 
			
		
		
		
	Fixed: Whitespace being striped from the end of IME strings incorrectly + Regression with SDL_SetTextInputRect (#4752)
* Fixed: Whitespace being striped from the end of IME strings incorrectly * Fixed: Google IME Candidate Window not placing correctly * Why are PostBuild events stored in the vcxproj and not a user file? * Revert SDL.vcxproj properly... * Remove whitespace as per code review * Fix Werror=declaration-after-statement error in code
This commit is contained in:
		| @@ -246,13 +246,20 @@ WIN_SetTextInputRect(_THIS, SDL_Rect *rect) | |||||||
|     himc = ImmGetContext(videodata->ime_hwnd_current); |     himc = ImmGetContext(videodata->ime_hwnd_current); | ||||||
|     if (himc) |     if (himc) | ||||||
|     { |     { | ||||||
|         CANDIDATEFORM cf; |         COMPOSITIONFORM cof; | ||||||
|         cf.dwIndex = 0; |         CANDIDATEFORM caf; | ||||||
|         cf.dwStyle = CFS_POINT; |  | ||||||
|         cf.ptCurrentPos.x = videodata->ime_rect.x; |         cof.dwStyle = CFS_FORCE_POSITION; | ||||||
|         cf.ptCurrentPos.y = videodata->ime_rect.y; |         cof.ptCurrentPos.x = videodata->ime_rect.x; | ||||||
|  |         cof.ptCurrentPos.y = videodata->ime_rect.y; | ||||||
|  |         ImmSetCompositionWindow(himc, &cof); | ||||||
|  |  | ||||||
|  |         caf.dwIndex = 0; | ||||||
|  |         caf.dwStyle = CFS_CANDIDATEPOS; | ||||||
|  |         caf.ptCurrentPos.x = videodata->ime_rect.x; | ||||||
|  |         caf.ptCurrentPos.y = videodata->ime_rect.y; | ||||||
|  |         ImmSetCandidateWindow(himc, &caf); | ||||||
|  |  | ||||||
|         ImmSetCandidateWindow(himc, &cf); |  | ||||||
|         ImmReleaseContext(videodata->ime_hwnd_current, himc); |         ImmReleaseContext(videodata->ime_hwnd_current, himc); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -748,13 +755,16 @@ IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD string) | |||||||
|  |  | ||||||
|     length /= sizeof(videodata->ime_composition[0]); |     length /= sizeof(videodata->ime_composition[0]); | ||||||
|     videodata->ime_cursor = LOWORD(ImmGetCompositionStringW(himc, GCS_CURSORPOS, 0, 0)); |     videodata->ime_cursor = LOWORD(ImmGetCompositionStringW(himc, GCS_CURSORPOS, 0, 0)); | ||||||
|     if (videodata->ime_cursor < SDL_arraysize(videodata->ime_composition) && videodata->ime_composition[videodata->ime_cursor] == 0x3000) { |     if (videodata->ime_cursor > 0 && | ||||||
|  |         videodata->ime_cursor < SDL_arraysize(videodata->ime_composition) && | ||||||
|  |         videodata->ime_composition[videodata->ime_cursor] == 0x3000) { | ||||||
|         int i; |         int i; | ||||||
|         for (i = videodata->ime_cursor + 1; i < length; ++i) |         for (i = videodata->ime_cursor + 1; i < length; ++i) | ||||||
|             videodata->ime_composition[i - 1] = videodata->ime_composition[i]; |             videodata->ime_composition[i - 1] = videodata->ime_composition[i]; | ||||||
|  |  | ||||||
|         --length; |         --length; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     videodata->ime_composition[length] = 0; |     videodata->ime_composition[length] = 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zach Reedy
					Zach Reedy