Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 434393
Collapse All | Expand All

(-)a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java (-7 / +9 lines)
Lines 2152-2163 Link Here
2152
public long /*int*/ internal_new_GC (GCData data) {
2152
public long /*int*/ internal_new_GC (GCData data) {
2153
	checkWidget();
2153
	checkWidget();
2154
	NSView view = paintView();
2154
	NSView view = paintView();
2155
	long /*int*/ context = 0;
2155
	NSGraphicsContext graphicsContext = null;
2156
	if (data != null && data.paintRect != null) {
2156
	if (data != null && data.paintRect != null) {
2157
		NSGraphicsContext graphicsContext = NSGraphicsContext.currentContext();
2157
		graphicsContext = NSGraphicsContext.currentContext();
2158
		context = graphicsContext.id;
2159
		if (!view.isFlipped()) data.state &= ~VISIBLE_REGION;
2158
		if (!view.isFlipped()) data.state &= ~VISIBLE_REGION;
2160
	} else {
2159
	}
2160
	if (graphicsContext == null) {
2161
		NSWindow window = view.window();
2161
		NSWindow window = view.window();
2162
		/*
2162
		/*
2163
		 * Force the device to be created before attempting
2163
		 * Force the device to be created before attempting
Lines 2170-2179 Link Here
2170
			window.orderOut(null);
2170
			window.orderOut(null);
2171
			window.setAlphaValue(alpha);
2171
			window.setAlphaValue(alpha);
2172
		}
2172
		}
2173
		NSGraphicsContext graphicsContext = NSGraphicsContext.graphicsContextWithWindow (window);
2173
		graphicsContext = NSGraphicsContext.graphicsContextWithWindow (window);
2174
		NSGraphicsContext flippedContext = NSGraphicsContext.graphicsContextWithGraphicsPort(graphicsContext.graphicsPort(), true);
2174
		NSGraphicsContext flippedContext = NSGraphicsContext.graphicsContextWithGraphicsPort(graphicsContext.graphicsPort(), true);
2175
		graphicsContext = flippedContext;
2175
		graphicsContext = flippedContext;
2176
		context = graphicsContext.id;
2177
		if (data != null) {
2176
		if (data != null) {
2178
			data.flippedContext = flippedContext;
2177
			data.flippedContext = flippedContext;
2179
			data.state &= ~VISIBLE_REGION;
2178
			data.state &= ~VISIBLE_REGION;
Lines 2197-2203 Link Here
2197
		data.background = control.getBackgroundColor ().handle;
2196
		data.background = control.getBackgroundColor ().handle;
2198
		data.font = font != null ? font : defaultFont ();		
2197
		data.font = font != null ? font : defaultFont ();		
2199
	}
2198
	}
2200
	return context;
2199
	if (graphicsContext != null) {
2200
		return graphicsContext.id;
2201
	}
2202
	return 0;
2201
}
2203
}
2202
2204
2203
/**	 
2205
/**	 

Return to bug 434393