Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317219 - Shell.moveAbove() should not show widget if not visible
Summary: Shell.moveAbove() should not show widget if not visible
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 3.7 RC1   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-17 12:47 EDT by Bogdan Gheorghe CLA
Modified: 2011-05-02 15:43 EDT (History)
4 users (show)

See Also:
eclipse.felipe: review+


Attachments
fix (709 bytes, application/octet-stream)
2011-04-29 10:40 EDT, Silenio Quarti CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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