|
Lines 149-171
Link Here
|
| 149 |
|
149 |
|
| 150 |
static void GtkInit () |
150 |
static void GtkInit () |
| 151 |
{ |
151 |
{ |
| 152 |
#if NET_2_0 |
152 |
AvoidAccessibilityConflicts (false); |
| 153 |
// NOTE: SetEnvironmentVariable not available in 1.x |
|
|
| 154 |
// Prevent ATK bridge initalization, as it causes |
| 155 |
// conflicts with the UIA<->ATK bridge. |
| 156 |
// A better solution would probably be to get these |
| 157 |
// values out-of-process. See details/discussion here: |
| 158 |
// https://bugzilla.novell.com/show_bug.cgi?id=375987 |
| 159 |
string gtk_modules_env_var = "GTK_MODULES"; |
| 160 |
string gtk_modules_env_var_content = Environment.GetEnvironmentVariable (gtk_modules_env_var); |
| 161 |
Environment.SetEnvironmentVariable (gtk_modules_env_var, string.Empty); |
| 162 |
#endif |
| 163 |
|
153 |
|
| 164 |
gtk_init_check (IntPtr.Zero, IntPtr.Zero); |
154 |
gtk_init_check (IntPtr.Zero, IntPtr.Zero); |
| 165 |
|
155 |
|
| 166 |
#if NET_2_0 |
156 |
AvoidAccessibilityConflicts (true); |
| 167 |
Environment.SetEnvironmentVariable (gtk_modules_env_var, gtk_modules_env_var_content); |
|
|
| 168 |
#endif |
| 169 |
} |
157 |
} |
| 170 |
#endregion // Constructors |
158 |
#endregion // Constructors |
| 171 |
|
159 |
|
|
Lines 194-199
Link Here
|
| 194 |
// Do nothing; all is done in our static ctor |
182 |
// Do nothing; all is done in our static ctor |
| 195 |
} |
183 |
} |
| 196 |
|
184 |
|
|
|
185 |
|
| 186 |
static string gtk_modules_env_var_content = null; |
| 187 |
static string atk_bridge_env_var_content = null; |
| 188 |
|
| 189 |
// Prevent ATK bridge initalization, as it causes |
| 190 |
// conflicts with the UIA<->ATK bridge. |
| 191 |
static void AvoidAccessibilityConflicts (bool restore) { |
| 192 |
// NOTE: SetEnvironmentVariable not available in 1.x |
| 193 |
#if NET_2_0 |
| 194 |
|
| 195 |
string gtk_modules_env_var_name = "GTK_MODULES"; |
| 196 |
string atk_bridge_env_var_name = "NO_AT_BRIDGE"; |
| 197 |
|
| 198 |
if (!restore) { |
| 199 |
// Solution for gtk+ < 2.14: |
| 200 |
// (A better solution would probably be to get these |
| 201 |
// values out-of-process. See details/discussion here: |
| 202 |
// https://bugzilla.novell.com/show_bug.cgi?id=375987 ) |
| 203 |
gtk_modules_env_var_content = Environment.GetEnvironmentVariable (gtk_modules_env_var_name); |
| 204 |
Environment.SetEnvironmentVariable (gtk_modules_env_var_name, string.Empty); |
| 205 |
|
| 206 |
// Solution for gtk+ >= 2.14 [requires atk-bridge version > 1.25.2 (r1136, Gnome 2.24.2)] |
| 207 |
// see https://bugzilla.novell.com/show_bug.cgi?id=457787 |
| 208 |
atk_bridge_env_var_content = Environment.GetEnvironmentVariable (atk_bridge_env_var_name); |
| 209 |
Environment.SetEnvironmentVariable (atk_bridge_env_var_name, "0"); |
| 210 |
} else { |
| 211 |
Environment.SetEnvironmentVariable (gtk_modules_env_var_name, gtk_modules_env_var_content); |
| 212 |
gtk_modules_env_var_content = null; |
| 213 |
Environment.SetEnvironmentVariable (atk_bridge_env_var_name, atk_bridge_env_var_content); |
| 214 |
atk_bridge_env_var_content = null; |
| 215 |
} |
| 216 |
#endif |
| 217 |
} |
| 218 |
|
| 197 |
private static Color ColorFromGdkColor (GdkColorStruct gtkcolor) { |
219 |
private static Color ColorFromGdkColor (GdkColorStruct gtkcolor) { |
| 198 |
return Color.FromArgb (255, |
220 |
return Color.FromArgb (255, |
| 199 |
(gtkcolor.red >> 8) & 0xff, |
221 |
(gtkcolor.red >> 8) & 0xff, |