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

Bug 109290

Summary: [WorkbenchLauncher] splash screen blocks the switch workspace dialog and creates illusion of hung application
Product: [Eclipse Project] Platform Reporter: Stuart Mackey <smackey>
Component: UIAssignee: Kim Horne <eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, billy.biggs, CWNL-Eclipse-Bugs, desarmo, emoffatt, gsmith, jastein, matt.casson, paul.melching, pwebster, rwatts, Silenio_Quarti, snorthov, wmitsuda
Version: 3.1   
Target Milestone: 3.4 M7   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 161569    
Bug Blocks:    
Attachments:
Description Flags
Dumb patch. Nowhere near final.
none
A better patch. none

Description Stuart Mackey CLA 2005-09-12 09:56:50 EDT
While starting up the "select workspace" dialog sometimes comes up behind the
splashscreen and is completely obscured.

A user may interpret this as the application having hung.
Comment 1 Billy Biggs CLA 2005-09-12 10:01:44 EDT
What window manager are you using?
Comment 2 Stuart Mackey CLA 2005-09-12 10:15:10 EDT
Gnome / Metacity
Fedora Core 3

$ uname -a
Linux 2.6.11-1.35_FC3smp #1 SMP Mon Jun 13 01:17:35 EDT 2005 i686 i686 i386
GNU/Linux
Comment 3 Stuart Mackey CLA 2005-09-12 10:20:30 EDT
I'm having trouble replicating this myself exactly. Maybe what *really* happened
is that I accidentally clicked on the splashscreen beneath the select workspace
dialog which brought it forward and at that point hid enough of the 'select
workspace' dialog to that it was no longer obvious the dialog was back there.

So I'm tempted to think it's user error now. But, would it be possible to make
the select workspace dialog modal in such a way that it can never be 'hidden'
behind the splashscreen even if the user accidentally clicks on part of the
splashscreen?
Comment 4 Billy Biggs CLA 2005-09-12 10:22:55 EDT
Unfortunately, the splash screen is opened from a separate process, so it's hard
to coordinate a relationship between them.  metacity also tries to do some focus
stealing prevention which can affect the stacking order.
Comment 5 Billy Biggs CLA 2005-09-12 10:25:06 EDT
I'm not sure what else we can do that's reasonable.  Boris, this is the classic
problem of having the workspace launcher maybe be a real dialog for the splash
screen window.
Comment 6 Boris Bokowski CLA 2005-09-12 10:48:50 EDT
In recent builds, the Workspace Launcher is opened as a top-level shell, so it 
should show up in the task bar. (In 3.1, it might not appear on the task bar.)

Which build were you using?
Comment 7 Billy Biggs CLA 2005-09-12 10:51:20 EDT
it has always appeared in the task bar on Linux, the issue here is the stacking
order.
Comment 8 Boris Bokowski CLA 2005-09-12 14:25:15 EDT
On Paul's Linux box with GNOME, using 3.1, the Workspace Launcher does not
appear in the task bar. With a recent build, it does appear.

Short of fixing the root cause, we could do one of the following:

- Make the dialog bigger (taller, wider) than the splash screen. Splash screens,
according to the spec, "should be approximately 500x330 pixels in size".
- Use Shell.forceActive() to bring the dialog to the front (does this work on
Linux)?

Any opinions, or other/better ideas?
Comment 9 Boris Bokowski CLA 2006-10-25 14:21:16 EDT
*** Bug 162234 has been marked as a duplicate of this bug. ***
Comment 10 Boris Bokowski CLA 2006-10-25 14:22:55 EDT
This can happen on Windows too.  I'm afraid we cannot solve this unless the splash screen is shown from within Eclipse using SWT.
Comment 11 Boris Bokowski CLA 2007-01-02 11:15:18 EST
Reassigning bugs to reflect changes in ownership.
Comment 12 Kim Horne CLA 2007-06-27 11:27:52 EDT
The splash is now wrappered via SWT but this happens long after the workspace dialog is opened.  Still, it may be possible for us to do something here.  I'll investigate.
Comment 13 Kristen Desarmo CLA 2007-11-15 13:23:32 EST
We see this frequently on Windows and have several defects opened against our product about this.

Comment 14 Kim Horne CLA 2007-11-15 14:21:36 EST
Kristin: I'd be curious to know what versions of Eclipse you product is delivered on.
Comment 15 Kristen Desarmo CLA 2007-11-15 14:36:45 EST
We're on 3.2.2
Comment 16 Kim Horne CLA 2008-01-18 13:37:53 EST
I've been working at this off and on for some time now.  I have the ability to parent the shell off of the splash screen which manages to fix this issue but causes more of them on Windows (and perhaps linux - I haven't checked there but I suspect it'd be problematic there as well).

The issue on Windows is that the splash shell is created with the shell style bits for WS_EX_TOOLWINDOW set.  This means that the shell is created without having an entry in either the task bar or in the alt-tab list.  When we then parent the chooser shell off of it we are now in the state where you can no longer alt-tab to the chooser which, IMO, is far far worse than having it appear under the splash.

Silenio: would it be possible for you to reset this style bit in the special constructor you gave us using ModifyStyleEx()? 

Comment 17 Silenio Quarti CLA 2008-01-24 09:45:10 EST
I believe it is possible to change the style on the fly, but there was a reason to remove the window from the task bar. Modifing the style will bring that bug back.

Andrew do remember why? Can we avoid setting WS_EX_TOOLWINDOW and fix the original problem some other way?
Comment 18 Andrew Niefer CLA 2008-01-24 11:16:43 EST
I believe it has to do with the icon and title of the window in the case where java is launched in a separate process from the launcher.  The launcher.dll has no icon in it because it may be shared accross products.

I don't know if I'm imagining this, but I think that the icon and title where ok once the workspace chooser dialog came up by virtue of being set by swt (?)

If this is the case, then modifying the style at that point will be ok.
Comment 19 Kim Horne CLA 2008-02-04 13:53:29 EST
*** Bug 120648 has been marked as a duplicate of this bug. ***
Comment 20 Kim Horne CLA 2008-03-26 12:46:05 EDT
(In reply to comment #18)
> I believe it has to do with the icon and title of the window in the case where
> java is launched in a separate process from the launcher.  The launcher.dll has
> no icon in it because it may be shared accross products.
> 
> I don't know if I'm imagining this, but I think that the icon and title where
> ok once the workspace chooser dialog came up by virtue of being set by swt (?)
> 
> If this is the case, then modifying the style at that point will be ok.
> 

Okay, assuming we're all right here, could we have a method on win32 at least to switch the style for the shell?  It's too late for API but this doesn't necessarily make sense for API anyway.  Silenio?
Comment 21 Kim Horne CLA 2008-03-26 12:47:16 EDT
(Removing the target milestone until we're sure we can move forward on this)
Comment 22 Steve Northover CLA 2008-03-26 15:31:41 EDT
Kim, can't the workspace switcher dialog be created as a child of the splash screen?  That way it will stay in front.  I'm sure you've tried this right?
Comment 23 Kim Horne CLA 2008-03-26 15:40:13 EDT
(In reply to comment #22)
> Kim, can't the workspace switcher dialog be created as a child of the splash
> screen?  That way it will stay in front.  I'm sure you've tried this right?
> 

Sure, but as I mentioned above, this is problematic on Windows because the splash is made with the WS_EX_TOOLWINDOW bit.  I can parent off of it but then I dont get anything in the taskbar.  What I was looking for was a way to remove that style bit (causing the splash to have a taskbar entry) after we're up to the point where we're opening the chooser dialog.
Comment 24 Steve Northover CLA 2008-03-26 16:57:54 EDT
We released code that makes the splash screen appear in the task list when a dialog shell is created.  There is no new API.  Please parent the workspace prompter from the splash screen and try it out.
Comment 25 Kim Horne CLA 2008-03-28 13:36:25 EDT
(In reply to comment #24)
> We released code that makes the splash screen appear in the task list when a
> dialog shell is created.  There is no new API.  Please parent the workspace
> prompter from the splash screen and try it out.
> 

I've got your latest code checked out and I'm stepping through it (with changes at our end to parent the shell off the splash) but it doesn't appear to do anything.  There still isn't an entry in the taskbar for the new eclipse instance after calling OS.SetWindowLong(hwndParent, OS.GWL_EXSTYLE, style| OS.WX_EX_APPWINDOW).
Comment 26 Steve Northover CLA 2008-03-28 14:37:21 EDT
Funny, this worked on Silenio's machine when we started Eclipse within Eclipse.  We've never tested it on a single Eclipse.  Perhaps this doesn't work on Silenio's machine either, just like it doesn't work on yours?
Comment 27 Kim Horne CLA 2008-03-28 14:48:48 EDT
(In reply to comment #26)
> Funny, this worked on Silenio's machine when we started Eclipse within Eclipse.
>  We've never tested it on a single Eclipse.  Perhaps this doesn't work on
> Silenio's machine either, just like it doesn't work on yours?
> 

I was self-hosting as well.  
Comment 28 Kim Horne CLA 2008-03-28 16:57:21 EDT
Created attachment 94066 [details]
Dumb patch.  Nowhere near final.
Comment 29 Kim Horne CLA 2008-03-31 14:03:58 EDT
Created attachment 94269 [details]
A better patch.
Comment 30 Kim Horne CLA 2008-04-01 09:14:27 EDT
Eric, could you give this patch a try on Vista if you have a moment?  You'll need to set your workspace location to @noDefault
Comment 31 Kim Horne CLA 2008-04-01 12:53:39 EDT
I've tested this patch on Windows (XP and Vista), GTK, and OS X.  I'm going to check it in now and verify on next build that it works on AIX/Motif/etc.  
Comment 32 Kim Horne CLA 2008-04-29 14:53:58 EDT
This has been behaving nicely for awhile now.  I'm going to mark this as verified in I20080429-0100.  If anyone objects, please reopen.