Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT modal dialog overlapped by non-modal dialog on Mac OS X
SWT modal dialog overlapped by non-modal dialog on Mac OS X [message #1574429] Tue, 20 January 2015 08:04 Go to next message
Daniel Haftstein is currently offline Daniel HaftsteinFriend
Messages: 4
Registered: January 2015
Junior Member
Greetings,

In our application we open a non-modal MessageDialog
with shellstyle: SWT.MODELESS | SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX and blockOnOpen: false
The parent-shell is obtained by PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().

The dialog seems to overlap modal dialogs. For this case, we search for open modal shells while the dialog opens and call forceActive() on a found shell to bring it back to the front.
This seems to work on windows and linux but does nothing visible on Mac OS X.

It does not even work manually. For example: Open the message-dialog while the preferences are open.
On Mac OS X it is not possible to bring the preference-page back to the front, the user will always have to drag the dialog away.

Any ideas?

Thanks in advance,
Daniel
Re: SWT modal dialog overlapped by non-modal dialog on Mac OS X [message #1575095 is a reply to message #1574429] Tue, 20 January 2015 16:21 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 877
Registered: January 2012
Senior Member

If it's modeless, perhaps you shouldn't be specifying a parent shell at all? Use
SWT.ON_TOP
instead?

Brian.
Re: SWT modal dialog overlapped by non-modal dialog on Mac OS X [message #1575466 is a reply to message #1575095] Tue, 20 January 2015 21:00 Go to previous messageGo to next message
Marcel Bruch is currently offline Marcel BruchFriend
Messages: 289
Registered: July 2009
Senior Member

Thanks Brian. I just gave it a spin. Passing null as parent shell relaxes the issue on Mac a bit. But then the error dialog can be moved behind the main window, which is confusing in a different way. Any chance to get the error dialog always on top of the workbench window but below another modal dialog with the same parent shell?


https://bugs.eclipse.org/bugs/show_bug.cgi?id=457115
Re: SWT modal dialog overlapped by non-modal dialog on Mac OS X [message #1576953 is a reply to message #1575466] Wed, 21 January 2015 16:28 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 877
Registered: January 2012
Senior Member

I like to think of the parent shells as providing the window system a set of constraints for ordering. Basically by using the active window for your other dialog, you're saying to the window system that it's as important as any other dialogs specifying the active window.

If you want to ensure your dialog is on top of your top-most dialog, find your top-most dialog and specify it as your dialog parent. Don't use the active window (btw: realize that getActiveWorkbenchWindow() can return null). You could even consider Display.getActiveShell().

It sounds like you have particular semantics for this dialog, especially as to how it relates to other dialogs, but it's not clear what they are.

Brian.
Previous Topic:Can't Display SWT Image on Linux (Large Image)
Next Topic:[SOLVED] Cannot run JUnit Plug-in Tests on Linux
Goto Forum:
  


Current Time: Sat Feb 27 19:44:41 GMT 2021

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

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

Back to the top