summaryrefslogtreecommitdiffstats
path: root/opengl.c
diff options
context:
space:
mode:
authorRichard Grenville <pyxlcy@gmail.com>2013-09-15 08:56:53 +0800
committerRichard Grenville <pyxlcy@gmail.com>2013-09-15 08:56:53 +0800
commit9c609b9b97eee09e975d96082ffab32543258251 (patch)
tree2fd93864474c5d1f077f47e0b50967951c6cfe54 /opengl.c
parent631f50d665057a034d4cd22b49e030d1913ab79a (diff)
downloadtdebase-9c609b9b97eee09e975d96082ffab32543258251.tar.gz
tdebase-9c609b9b97eee09e975d96082ffab32543258251.zip
Bug fix #143: GLSL shader error on European locales
Set LC_NUMERIC=C when generating GLSL shader strings to avoid decimal point issues on European locales. Thanks to hiciu for reporting.
Diffstat (limited to 'opengl.c')
-rw-r--r--opengl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/opengl.c b/opengl.c
index a26a286f4..33a2fc724 100644
--- a/opengl.c
+++ b/opengl.c
@@ -225,6 +225,11 @@ glx_init_blur(session_t *ps) {
#ifdef CONFIG_VSYNC_OPENGL_GLSL
{
+ char *lc_numeric_old = mstrcpy(setlocale(LC_NUMERIC, NULL));
+ // Enforce LC_NUMERIC locale "C" here to make sure decimal point is sane
+ // Thanks to hiciu for reporting.
+ setlocale(LC_NUMERIC, "C");
+
static const char *FRAG_SHADER_BLUR_PREFIX =
"#version 110\n"
"%s"
@@ -331,6 +336,10 @@ glx_init_blur(session_t *ps) {
#undef P_GET_UNIFM_LOC
}
free(extension);
+
+ // Restore LC_NUMERIC
+ setlocale(LC_NUMERIC, lc_numeric_old);
+ free(lc_numeric_old);
}