Bug 35768 - Wrong window comes to the front
Summary: Wrong window comes to the front
Status: RESOLVED DUPLICATE of bug 166483
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC All
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted, investigate
: 36734 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-03-27 13:15 EST by Steve Northover CLA
Modified: 2007-07-04 12:20 EDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Northover CLA 2003-03-27 13:15:22 EST
Bad things happen on both GTK and Windows.  Not quite sure if all these steps
are needed but I'm including everything.

On GTK, do this:

1) Get a fresh GTK Eclipse (eclipse-SDK-I20030326-linux-gtk.zip)
2) Open Perspective->CVS Repositry Exploring
    - connect to dev.eclipse.org
    - expand HEAD
    - multi-select org.eclipse.swt, org.eclipse.swt.gtk, org.eclipse.swt.examples
    - check out as project
3) Open Perspective->Other...->Java Perspective
4) Window->New Window
5) expand org.eclipse.swt.gtk
6) expand os.linux.x86
7) multi-select the 3 lib files (libswt-gnome-gtk-XXX ...)
8) Export->File system->Next
9) ***BUG!
    - no libraries are selected in the export dialog
10) select the 3 lib files from 7) in the dialog
11) export them into your jre/bin (probably doesn't matter the directory)
12 ***BUG!
    - wrong window comes to the front

On Motif do this:

... steps in progress (stay tuned)
Comment 1 Steve Northover CLA 2003-03-27 13:27:58 EST
Do the steps on Windows and Motif and the wrong window comes to the front 
after step 8).
Comment 2 Kevin Haaland CLA 2003-03-27 14:19:48 EST
Doesn't happen in the Navigator.
Comment 3 Simon Arsenault CLA 2003-03-27 16:10:01 EST
This is a JDT problem. In their ImportActionGroup class, they create the import 
and export actions. But they are using the old deprecated constructors. They 
should use the constructor where you past in the actual window (you already 
known the window via part.getSite().getWorkbenchWindow()).
Comment 4 Dirk Baeumer CLA 2003-03-27 18:08:09 EST
If the ImportResourcesAction would call workbench.getActiveWorkbenchWindow() 
in the run method instead of the constructor the this would fix the problem 
for other clients still using the deprecated API as well.
Comment 5 Dirk Baeumer CLA 2003-04-22 03:21:34 EDT
*** Bug 36734 has been marked as a duplicate of this bug. ***
Comment 6 Dirk Baeumer CLA 2003-04-22 03:37:26 EDT
Simon, any comments regarding comment #4
Comment 7 Simon Arsenault CLA 2003-04-22 09:32:52 EDT
Sorry about that...I was going to comment on this but things got busy with 2.1 
release!

At the moment, there is some discussion about removing a bunch of deprecated 
API for the 3.0 release (to ease the maintenance). This would be one of them.

If the decision is to keep this old API, I will seriously consider making the 
change you requested. The down side is it spreads code to support deprecated 
API into other parts of the class.
Comment 8 Dirk Baeumer CLA 2003-12-16 08:45:38 EST
The group now calls the constructors taking an IWorkbenchWindow. Moving to 
Platform UI to consider the comment #4 for the deprecated methods.
Comment 9 Nick Edgar CLA 2003-12-16 09:48:44 EST
We're not removing deprecated API for 3.0, so I'll make the suggested change.
Should scan for other uses of getActiveWorkbenchWindow(), which we never should 
have provided in the first place <g>.

Comment 10 Nick Edgar CLA 2004-01-26 19:16:41 EST
Should fix ExportResourcesAction as well.
Comment 11 Michael Van Meekeren CLA 2004-05-25 12:26:43 EDT
deffering, if you feel this is important for R3.0 please re-open.
Comment 12 Steve Northover CLA 2004-05-25 12:31:41 EDT
MVM, I would like multiple windows to work better in 3.0.  They did not work 
well in 2.1.x so I don't think there is a regression.
Comment 13 Nick Edgar CLA 2004-05-27 17:39:58 EDT
Steve, do you have some concrete cases that are problematic?
Comment 14 Steve Northover CLA 2004-06-03 14:43:50 EDT
I don't have a repeatable case but it's still happening.  Seems more likely 
when a full build is happening but I can't be sure.
Comment 15 Steve Northover CLA 2004-06-04 10:01:13 EDT
Version: 3.0.0
Build id: 200405290105

Just happened to me again, this time expanding a package tree in a packages 
view order to see the classes.  First it took about 3 centuries, then it 
brought the wrong window to the front.  Very annoying.

There were lots of classes in the package.  It seems that that the wrong 
window comes to the front when an operation takes a long time.  I'm pretty 
sure I've never seen it happen otherwise.
Comment 16 Nick Edgar CLA 2004-06-04 10:39:18 EDT
Dirk, does the package explorer kick off any jobs, or report progress in any
other way, when a package is expanded?  What happens when the Java Model needs
to do some work to get the list?
Comment 17 Dirk Baeumer CLA 2004-06-04 13:48:57 EDT
The package explorer doesn't kick off any job to get the children of a 
package. We call fragment.getCompilationUnits() & fragment.getNonJavaResources
() or fragment.getClassFiles() & fragment.getNonJavaResources() depending on 
whether the package contains binaries or sources. Both don't take a progress 
monitor so we don't report any progress either.

CC Philippe to answer Nicks questions regarding the Java Model.
Comment 18 Nick Edgar CLA 2004-06-14 10:53:11 EDT
I'm sometimes seeing the wrong window get activated, usually when doing an
override and update from the sync view.  In this case, though, it's not another
workbench window that gets activated, it's another app's window!

Steve, any idea how this could be possible?
Comment 19 Steve Northover CLA 2004-06-14 12:16:54 EDT
I think this can happen when Windows tries to activate a shell that is 
disabled.  When a shell is disabled, it is frozen on the desktop.  I will 
attempt to construct a simple example.
Comment 20 Nick Edgar CLA 2005-04-28 17:09:08 EDT
Steve, do you still see this?
Comment 21 Steve Northover CLA 2005-04-28 17:48:28 EDT
I stopped seeing it before 3.0 and during most of the M's up until the last 
few weeks and then it started happening again.  I know that Team made some 
changes around "trying to find the right parent for a dialog" (I don't have 
the PR or the details).

I have a simple example somewhere of how to make Windows do this.  Not sure 
how to proceed.
Comment 22 Nick Edgar CLA 2005-04-28 18:14:18 EDT
Which dialogs do you typically see it with?

A few weeks ago, we changed the heuristic in the code which determines which
parent a dialog gets, for some of the error dialogs.
Comment 23 Steve Northover CLA 2005-04-28 18:16:16 EDT
It's not the dialog, it a whole other Eclipse shell.  I'll add to this bug 
report if I see it again and include the build number.
Comment 24 Nick Edgar CLA 2006-03-15 14:00:31 EST
Reassigning bugs in component areas that are changing ownership.
Comment 25 Susan McCourt CLA 2006-04-19 17:45:56 EDT
Apparently we ask this question every spring...
Steve, do you still see this?
At any rate, moving prio to P3 since this is so stale.
Comment 26 Steve Northover CLA 2006-04-19 18:05:47 EDT
I didn't try the steps again but, yes, the wrong window comes to the front even more using the debugger.  I believe I entered a separate bug report for that.
Comment 27 Steve Northover CLA 2006-12-21 11:20:27 EST
Now, the wrong window is coming to the front in the compare view.  It's happening to Boris now too.
Comment 28 Boris Bokowski CLA 2006-12-21 11:38:14 EST
I entered bug 166483, not sure if it is a duplicate, or a separate issue.
Comment 29 Susan McCourt CLA 2007-06-28 15:00:58 EDT
I'm going to assume that the fix in bug #166483 addressed this issue. Please reopen if you think this is a bad assumption.

*** This bug has been marked as a duplicate of bug 166483 ***
Comment 30 Steve Northover CLA 2007-07-04 12:20:48 EDT
Go ahead and mark it any way you want.  It has been happening since 2003 and  I have long since given up hope that it will be fixed.  It doesn't have steps, doesn't happen every time etc. and I have been unable to spend the time to get to the bottom of it myself due to other work.