Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Albireo » Restoring the active shell in SwtInputBlocker does not work properly
Restoring the active shell in SwtInputBlocker does not work properly [message #575155] Tue, 26 May 2009 14:46
Dominik Kaspar is currently offline Dominik Kaspar
Messages: 12
Registered: July 2009
Junior Member
If the SwtInputBlocker is used for a modal awt dialog it tries to restore
the last active shell when the awt dialog closes. This is done because
windows from other applications could be openeded during SWT was being
blocked (SwtInputBlocker line 116).

When the method block(AwtDialogListener dialogListener) is called the
SwtInputBlocker tries to remember the active shell. This fails because
display.getActiveShell() does mostly return null. In this case the first
shell will be taken from the display. If you work with more than 1 shell
at the same time and you open/close a swing dialog, always the first shell
from the display gets the focus not the original parent.

I added a SWT.Activate listener to the display in the AwtDialogListener to
remember the last active shell. Any better solutions?

Another problem is if you start a complete new awt window, lets say for
JasperReports, from a swt context and open a new awt modal dialog from
there, if you close the awt dialog the swt shell gets the focus not the
awt window from JasperReports which was the parent.

Regards
Dominik
Previous Topic:Restoring the active shell in SwtInputBlocker does not work properly
Next Topic:More tips for the sample code
Goto Forum:
  


Current Time: Mon Sep 22 06:31:09 GMT 2014

Powered by FUDForum. Page generated in 0.16163 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software