Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317219

Summary: Shell.moveAbove() should not show widget if not visible
Product: [Eclipse Project] Platform Reporter: Bogdan Gheorghe <gheorghe>
Component: SWTAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, eclipse.felipe, remy.suen, skovatch
Version: 3.6Flags: eclipse.felipe: review+
Target Milestone: 3.7 RC1   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
fix none

Description Bogdan Gheorghe CLA 2010-06-17 12:47:09 EDT
Shell.moveAbove() doesn't show child area, just the frame. See snippet below:


=====

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;


public class Test {
public static void main(String[] args) {
	Display display = new Display();
	Shell shell = new Shell(display);
	shell.setLayout(new GridLayout(1, false));

	Button b = new Button(shell, SWT.PUSH);
	b.setText("PUSH ME");

	shell.setVisible(false);
	shell.moveAbove(null);

	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
	display.dispose();
}
}
Comment 1 Scott Kovatch CLA 2010-06-17 13:21:36 EDT
So is the correct behavior that moveAbove() should implicitly make the window visible or that the call should be ignored because the window isn't visible?
Comment 2 Scott Kovatch CLA 2010-06-17 13:50:11 EDT
In Carbon moveAbove() (which eventually just calls BringToFront()) doesn't make the window visible. Need to check what win32 does.
Comment 3 Silenio Quarti CLA 2010-06-28 09:29:54 EDT
It should not make the window visible. We deed to see if it should change the stacking order when it is not visible.
Comment 4 Scott Kovatch CLA 2011-02-09 14:29:34 EST
Looking for advice on StackOverflow.com for this one. It doesn't seem to be possible to make a window visible while respecting its Z order. You can only orderFront, orderBack or order relative to another window. There's no ShowWindow equivalent in Cocoa.

I was going to ignore moveAbove() when the window isn't visible but then the window always shows up in front next time it's made visible, so that doesn't really help.
Comment 5 Silenio Quarti CLA 2011-04-29 10:40:40 EDT
Created attachment 194363 [details]
fix

The window must not be shown because of a call to moveAbove()/moveBelow().
Comment 6 Silenio Quarti CLA 2011-05-02 15:43:48 EDT
Fixed > 20110502