Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 52362 - [Coolbar] Dragging cool item to a new row in cool bar does not resize views
Summary: [Coolbar] Dragging cool item to a new row in cool bar does not resize views
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Stefan Xenos CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 53522 61659 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-18 10:05 EST by Douglas Pollock CLA
Modified: 2004-07-05 11:25 EDT (History)
7 users (show)

See Also:


Attachments
Patch to use the client area instead of the shell size (1.36 KB, patch)
2004-05-20 14:48 EDT, Billy Biggs CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas Pollock CLA 2004-02-18 10:05:43 EST
Normally, this would be filed as a cool bar bug, but this change in behaviour 
was introduced by the new look work.  It seems as though someone might 
ignoring an event that they should be paying attention to. 
 
 
STEPS TO REPRODUCE: 
1.) Grab one cool item in the cool bar, and try to drag it to a new row. 
 
 
OBSERVED RESULTS: 
The cool item goes into a new row, but that row is obscured by the views. 
 
 
DESIRED RESULTS: 
The views should be aware of the new limitations on their size and resize 
appropriately.
Comment 1 Debbie Wilson CLA 2004-02-18 12:07:42 EST
Mike,  Is this a dup of bug 51655?  
Comment 2 Michael Van Meekeren CLA 2004-02-18 12:17:25 EST
nope, does not look related to bug 51655
Comment 3 Douglas Pollock CLA 2004-03-03 10:20:44 EST
*** Bug 53522 has been marked as a duplicate of this bug. ***
Comment 4 Douglas Pollock CLA 2004-03-09 10:55:02 EST
Veronika: this is the bug we were talking about. 
Comment 5 Veronika Irvine CLA 2004-03-09 16:46:00 EST
The UI worknbench has lost some code that looked like this:

coolbar.addControlListener(new ControlAdapter() {
	public void controlResized(ControlEvent e) {
		Rectangle area = shell.getClientArea();
		FormData data = (FormData)(banner.getLayoutData());
		Point size = banner.computeSize(area.width, SWT.DEFAULT);
		data.height = size.y;
		shell.layout(true);
	}
});
Comment 6 Veronika Irvine CLA 2004-03-09 16:47:48 EST
Maybe Tod remembers where he put this code originally.
Comment 7 Michael Van Meekeren CLA 2004-03-09 17:52:41 EST
tod see last comment
Comment 8 Michael Van Meekeren CLA 2004-03-09 17:54:17 EST
stefan, this looks related to layout changes, could you comment on comment #5?
Comment 9 Tod Creasey CLA 2004-03-10 07:42:12 EST
This was a hack that was put in in the old layout due to the toolbar not 
resizing properly. It was in WorkbenchWindow.configureShell().

It was removed when the cool bar work was done as it was a hack to get around 
a resize problem that appeared to have been fixed.
Comment 10 Billy Biggs CLA 2004-04-02 12:02:28 EST
This bug no longer appears here.  Coolbars can now be moved to new rows
successfully.
Comment 11 Grant Gayed CLA 2004-04-02 13:48:38 EST
Agreed, this has worked for a while.  Closing.
Comment 12 Douglas Pollock CLA 2004-05-13 13:00:36 EDT
Problem still exists in I200405111600. 
Comment 13 Douglas Pollock CLA 2004-05-13 13:00:56 EDT
*** Bug 61659 has been marked as a duplicate of this bug. ***
Comment 14 Veronika Irvine CLA 2004-05-13 14:02:29 EDT
This is not a bug in SWT.  The UI code has to detect the resize of the coolbar 
and cause a layout on the whole shell.  Moving to Platform UI.
Comment 15 Michael Van Meekeren CLA 2004-05-13 14:31:18 EDT
stefan, can you look through here and note why this code is gone if you are 
aware of why..
Comment 16 Stefan Xenos CLA 2004-05-19 18:23:39 EDT
*** Bug 62411 has been marked as a duplicate of this bug. ***
Comment 17 Stefan Xenos CLA 2004-05-19 18:30:49 EDT
Fixed in head. There was caused by a combination of two bugs:

1. WorkbenchWindow was calling LayoutUtil.resize on the coolbar's parent,
although it should have been calling it on the coolbar itself.

2. LayoutUtil.resize was relying on SWT triggering a layout whenever setBounds
is called. However, SWT does not re-layout if the new bounds are the same as the
old one (this is the correct behavior when the layout is triggered by the parent
being resized, but not when the change is triggered by a child). I've added a
check to force a layout in this situation.

Comment 18 Billy Biggs CLA 2004-05-20 09:59:47 EDT
This is better but still not fixed in I200405200800.  The first time I drag a
coolitem to a new row, the new row is not created.  If I take a second coolitem
and drag it down, then the row is created, and after that point everything works
fine.  The first one does not work.  Reproducable on both Gtk+ 2.2 and Gtk+ 2.4.
Comment 19 Douglas Pollock CLA 2004-05-20 10:01:41 EDT
Please consider improving the fix for 3.0. 
Comment 20 Stefan Xenos CLA 2004-05-20 14:23:59 EDT
I can no longer reproduce this on windows.
Comment 21 Stefan Xenos CLA 2004-05-20 14:37:49 EDT
Billy, can you investigate the GTK issues?

I suspect the problem is in the coolbar resize listener in WorkbenchWindow,
which compares shell sizes to determine if a resize was triggered by a window
resize or a change in the CBanner or coolbar. The very first time, it may
erroneously believe that the shell size has changed because it hasn't recorded a
previous size yet.
Comment 22 Billy Biggs CLA 2004-05-20 14:48:11 EDT
Created attachment 10910 [details]
Patch to use the client area instead of the shell size

The problem is actually because asking for the shell size is unreliable in the
X Window System due to difficulties with window manager policies.  This patch
fixes the problem by using the shell's client area instead of its size.
Comment 23 Stefan Xenos CLA 2004-05-20 16:25:14 EDT
Checked in Billy's patch to WorkbenchWindow.
Comment 24 Tod Creasey CLA 2004-05-20 22:54:29 EDT
Verified in 20040520 - 21:14
Comment 25 Billy Biggs CLA 2004-05-21 09:21:34 EDT
Verified on I200405210010 using both Gtk+-2.2 and Gtk+-2.4.
Comment 26 Ines Khelifi CLA 2004-05-21 09:34:32 EDT
Verifid with Build id: 200405210800 on Windows XP.
Comment 27 Ines Khelifi CLA 2004-05-21 09:41:52 EDT
Verifid with Build id: 200405210800 on Mac OS 10.3.3.
Comment 28 Michael Van Meekeren CLA 2004-06-02 13:43:37 EDT
I can still recreate this on R3.0 RC1 on Win XP.  
Comment 29 Stefan Xenos CLA 2004-06-03 00:56:00 EDT
Michael: what are you doing to recreate it? I can't reproduce this using the
steps in the original PR.
Comment 30 Michael Van Meekeren CLA 2004-07-05 11:25:55 EDT
I can't recreate this any longer.