Project: Eclipse_Platform_UI
Bug 63415 [Workbench] Sashes disappearing or being clipped or clipping CTabFolder
Reported: 2004-05-21 10:31:58 | Status: verified fixed

On Mac OS X, make all the sashes have a red background (so you can easily see what I am talking about). Now run eclipse and drag a horizontal sash. Notice that the sash is no longer positioned correctly. It may be hidden entirely behind a CTabFolder, or it my be positioned incorrectly so that it is a little bit below the top control and either partially behind or partially over top of the bottom control. The reason this is happening is because the bounds of the Sash are being set to a bogus location. In LayoutTreeNode.setBounds(Rectangle bounds), there is the code: int redistribute = bounds.width - SASH_WIDTH - total; and int redistribute = bounds.height - SASH_WIDTH - total; This redistribute value is always a negative value which makes the sash be located in a position different from where the user dropped the sash. The value is negative because LayoutPartSash.widgetSelected does not subtract off the sash width when it calls LayoutPartSash.setSizes(int left, int right) and therefore in LayoutTreeNode.setBounds, total = left + right already includes the width of the sash and the sash width is therefore being subtracted off twice. private void widgetSelected(int x, int y, int width, int height) { LayoutTree root = rootContainer.getLayoutTree(); LayoutTreeNode node = root.findSash(this); Rectangle nodeBounds = node.getBounds(); //Recompute ratio x -= nodeBounds.x; y -= nodeBounds.y; if(style == SWT.VERTICAL) { setSizes(x, nodeBounds.width - x); // !!! need to subtract the sash width from right //setRatio((float)(x - nodeBounds.x)/(float)nodeBounds.width); } else { setSizes(y, nodeBounds.height - y); // !!! need to subtract the sash width from right //setRatio((float)(y - nodeBounds.y)/(float)nodeBounds.height); } node.setBounds(nodeBounds); initDragRatios(); } Note: This problem is exacerbated on Mac OS X by the fact that the sash does not have a rubber band behaviour and must therefore be moved by SWT on each mouse move. As a result, the sash is not ending up in the place where it was being set by the application.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LayoutPartSash.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LayoutTreeNode.java