[Bf-blender-cvs] [b34f177] master: Fix T47841: Shift-space doesn't type space in type-in fields on Windows

Sergey Sharybin noreply at git.blender.org
Tue May 3 12:39:29 CEST 2016


Commit: b34f177a39ce9fdfac05f60d21f6b763833f00f2
Author: Sergey Sharybin
Date:   Tue May 3 12:18:53 2016 +0200
Branches: master
https://developer.blender.org/rBb34f177a39ce9fdfac05f60d21f6b763833f00f2

Fix T47841: Shift-space doesn't type space in type-in fields on Windows

Shift-space was reserved for IME support, however IME will only
be enabled on certain languages. We can avoid any IME-related
exceptions form other languages without too much trouble.

There's one weak point around ui_ime_is_lang_supported() tho,
which is it might be doing string comparison a bit too much
often now, this we can avoid by handling those checks from BLT.

===================================================================

M	source/blender/editors/interface/interface_handlers.c

===================================================================

diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index ce26405..c6cd03d 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -2950,11 +2950,12 @@ static bool ui_textedit_copypaste(uiBut *but, uiHandleButtonData *data, const in
 static bool ui_ime_is_lang_supported(void)
 {
 	const char *uilng = BLT_lang_get();
-	const bool is_lang_supported = STREQ(uilng, "zh_CN") ||
-	                               STREQ(uilng, "zh_TW") ||
-	                               STREQ(uilng, "ja_JP");
-
-	return ((U.transopts & USER_DOTRANSLATE) && is_lang_supported);
+	if (U.transopts & USER_DOTRANSLATE) {
+		return STREQ(uilng, "zh_CN") ||
+		       STREQ(uilng, "zh_TW") ||
+		       STREQ(uilng, "ja_JP");
+	}
+	return false;
 }
 
 /* enable ime, and set up uibut ime data */
@@ -3405,7 +3406,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
 #ifdef WITH_INPUT_IME
 		    &&
 		    !is_ime_composing &&
-		    !WM_event_is_ime_switch(event)
+		    (!WM_event_is_ime_switch(event) || !ui_ime_is_lang_supported())
 #endif
 		    )
 		{




More information about the Bf-blender-cvs mailing list