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

Bug 9063

Summary: Tear off windows do not work in Solaris w/ Motif
Product: [Eclipse Project] Platform Reporter: Robert Hartley <rhartley>
Component: SWTAssignee: Steve Northover <snorthov>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: grant_gayed
Version: 2.0Keywords: helpwanted
Target Milestone: ---   
Hardware: Sun   
OS: Solaris   
Whiteboard:

Description Robert Hartley CLA 2002-02-04 14:59:27 EST
Grabbing and tearing off a sub window by its title bar does not work in Linux-
Motif or Solaris.

The window movement rectangle appears afrer grabbing, and while moving the 
cursor, but the window does not appear on the root window/desktop after letting 
go.
Comment 1 Robert Hartley CLA 2002-02-11 10:25:14 EST
Installation information:
Solaris v7
CDE v 1.3
Motif v1.2

This is tested on a completely vanilla install of Solaris on  machine that was 
wiped clean for the purposes of testing Eclipse.  All that was added was the 
Jan 25/02 Eclipse stable release and the Sun JRE v1.3.1_02-b02

To reproduce the problem:
1 - From the "eclipse" directory created during install (without the workspace 
directory having been created), invoke "./eclipe" 
Main window appears with four sub windows: Welcome, Tasks, Outline and a tab 
stack with a Navigator and Repositories sub window.

2 - Grab the Navigator window's title bar using MB1. The window outline should 
appear with phantom lines as you move it, but it does not.  The cursor will 
change to indicate which drop location is allowed, but it is forbidden to drop 
the window onto the Desktop/root window.  The MS-Windows version allows this 
behaviour.

This may be part of the more generalized problem of Drag & Drop not working 
properly with Eclipse using Motif.
Comment 2 Kevin Haaland CLA 2002-04-23 10:05:06 EDT
This feature was written using Win32 specific support for reparenting widgets 
which is not provided on motif. There are no plans to change this behavior for 
2.0 => torn off view are not possible on any platform. 

Consider as a post 2.0 enhancement.
Comment 3 Robert Hartley CLA 2002-04-23 10:43:19 EDT
This is a snippet of code I use to enable tear off windows in Motif.

Sorry if it is obtuse, but I am trying to keep it short.

If you wish, I can send you a simple example of using Motif and tear off windows
so that any container can be torn off/on and used in its own floating window
with all the children intact.

	_tornoff = True;
	_originalWindow = XtWindow(XtParent(XtParent(w)));

	XtVaGetValues(XtParent(w),
		XmNwidth, &_width,
		XmNheight, &_height,
		NULL);
		
	std::cerr << "height: " << _height << "  width: " << _width << std::endl;

	XtManageChild(_drawingArea);

	XtUnmanageChild(XtParent(w));
	XReparentWindow(
		XtDisplay(w), 
		XtWindow(XtParent(w)),
		XtWindow(_drawingArea),
		0, 0);
	XtManageChild(XtParent(w));

Robert
Comment 4 Kevin Haaland CLA 2002-04-23 12:38:20 EDT
Moving to SWT. 
Comment 5 Mike Wilson CLA 2002-04-23 13:34:54 EDT
The code is interesting. Thank you. 

We will not have time to do anything with it before R2.0 ships, however. There 
are likely to be a significant number of subtle problems with using this 
approach (examples: which shell provides the menus? how are accelerators 
handled? is window<->screen coordinate transformation handled properly? are 
there impacts on clipping? drag&drop? etc.). From past experience, I can say 
that enabling a feature like this is typically much harder than it seems 
initially. 

In any case, if you are interested in implementing such a mechanism, you need 
to start by discussing possible API and implementations on the swt developer's 
mailing list. Before you propose something, you need to ensure that it is not 
incompatible with the support provided in GTK and win32.
Comment 6 Veronika Irvine CLA 2002-09-11 14:06:49 EDT
Moving from Later.
Comment 7 Steve Northover CLA 2002-09-12 09:25:42 EDT
Tear off windows no longer supported in Eclipse.