diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-09-23 18:48:28 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-09-23 18:48:28 +0400 |
commit | eaf354e222ec64dc0e258a53107ef1eca9ac341c (patch) | |
tree | 1ba37f32860bf2ee6df455d1848e0b7078ab3339 /intern/utfconv/utf_winfunc.c | |
parent | 97cb65df52ea61b23a8b760de48df7ddab4310a1 (diff) |
Fix related to #36319: restore SDL_VIDEODRIVER=dummy environment variable, it
seems that somehow not having this is causing keyboard events to be caught by
SDL. This was removed because it broke addons that could use SDL, now set the
environment variable only temporary during SDL initialization.
This may have been causing issues with keyboard events getting missed in the
game engine, but I couldn't confirm the issue here.
Diffstat (limited to 'intern/utfconv/utf_winfunc.c')
-rw-r--r-- | intern/utfconv/utf_winfunc.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/intern/utfconv/utf_winfunc.c b/intern/utfconv/utf_winfunc.c index 2ae261b44a8..19917571b5e 100644 --- a/intern/utfconv/utf_winfunc.c +++ b/intern/utfconv/utf_winfunc.c @@ -166,12 +166,23 @@ int uputenv(const char *name, const char *value) { int r = -1; UTF16_ENCODE(name); - UTF16_ENCODE(value); - if (name_16 && value_16) { - r = (SetEnvironmentVariableW(name_16,value_16)!= 0) ? 0 : -1; + if (value) { + /* set */ + UTF16_ENCODE(value); + + if (name_16 && value_16) { + r = (SetEnvironmentVariableW(name_16,value_16)!= 0) ? 0 : -1; + } + UTF16_UN_ENCODE(value); } - UTF16_UN_ENCODE(value); + else { + /* clear */ + if (name_16) { + r = (SetEnvironmentVariableW(name_16,NULL)!= 0) ? 0 : -1; + } + } + UTF16_UN_ENCODE(name); return r; |