Popup-dialog steals focus *only from MS Outlook*

  • Thread starter Andreas Leitgeb
  • Start date
A

Andreas Leitgeb

Some application "A" uses a class derived from
org.jdesktop.application.Task.InputBlocker

In the subclass it creates a (modal) JDialog by means of
JOptionPane.createDialog() (and dlg.setModal(true)) to allow
the user to cancel some running task.

Going busy with such a busy-dialog up may happen even without *immediately*
preceding interaction (but nevertheless principially expected by the user).
IOW., by the time the busy-dialog is shown, the user may have switched to
another application and use that.

Strangely, it depends on the applicaton the user then works at, whether
or not on going busy application "A" also comes to the foreground and
commits focus-theft (which it never really should.)

If user works on MS Outlook, then the busy-dialog comes to front, if
instead the user currently uses MS Word then the busy-dialog remains in the
back, until it is explicitly activated.

I was quite surprised about this dependency on currently active app, and
would like to know both, the reasons for this difference, and also how
to make the busy-dialog stay in the back even if MS Outlook is at the front.

It might sound weird, and it is. To make it really clear I describe two
scenarios: for simplicity, assume that app "A" enters busy-mode
one minute after some interaction "I" (this "one minute delay" is
just for the sake of simplification of this post, so please don't let
that sidetrack you.)

start "A" then do action "I" then open MS Word and type a text.
then a minute after interaction "I", the busy-dialog shows as a
blinking icon in the taskbar, and MS Word remains the active application.

start "A" then do action "I" then open MS Outlook and read or compose a mail.
then a minute after interaction "I", the busy-dialog pops up to front,
together with app "A"'s main window, and steals the focus from Outlook.

I'd like app "A" to behave with MS Oulook, just like it already behaves
with MS Word - or at least understand the difference between Outlook and
Word with respect to an Java-application's JDialog pop up behaviour...
 
A

Andreas Leitgeb

Andreas Leitgeb said:
If user works on MS Outlook, then the busy-dialog comes to front, if
instead the user currently uses MS Word then the busy-dialog stays in
the back, until it is explicitly activated.

We're now solving this, by avoiding the busy-dialog and instead embedding
progress-bar and cancel-button directly into the main window.

The mystery remains:
- Why does a popup JDialog steal the focus from MS Outlook,
but not from other applications?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top