View | Details | Raw Unified | Return to bug 457787
Collapse All | Expand All

(-)Managed.Windows.Forms/System.Windows.Forms/ChangeLog (+7 lines)
Lines 1-3 Link Here
1
2008-12-18  Andrés G. Aragoneses  <aaragoneses@novell.com>
2
3
	* X11DesktopColors.cs: Avoid gtk+ accessibility conflicts in more
4
	recent versions (see http://bugzilla.gnome.org/show_bug.cgi?id=563943).
5
	Function refactored to have a more readable GtkInit() as well.
6
	Fixes BNC#457787 .
7
1
2008-12-15  Brad Taylor  <brad@getcoded.net>
8
2008-12-15  Brad Taylor  <brad@getcoded.net>
2
9
3
	* ToolStripItem.cs: Add a UIA specific event for listening for when a
10
	* ToolStripItem.cs: Add a UIA specific event for listening for when a
(-)Managed.Windows.Forms/System.Windows.Forms/X11DesktopColors.cs (-14 / +36 lines)
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, 

Return to bug 457787