This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 34670 - Main window fronted when property sheet in options window creates a modal dialog
Summary: Main window fronted when property sheet in options window creates a modal dialog
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: mslama
URL:
Keywords: SIMPLEFIX
: 33080 33480 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-06-27 13:12 UTC by _ tboudreau
Modified: 2008-12-23 09:34 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Trivial patch to avoid fronting main window whenever a trivial dialog is shown (2.91 KB, patch)
2003-06-27 13:18 UTC, _ tboudreau
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2003-06-27 13:12:24 UTC
I first noticed how annoying this was when Jesse
was doing
a demo last year at OSCON.  The main window is
fronted 
whenever something displays a trivial dialog.

Since NbPresenter was moved to core/winsys, the
CVS history
is gone, so I can't find out if there was a real
issue that
caused it to be done this way.

I'm attaching a one line patch to use 
KeyboardFocusManager.getActiveWindow() and use
that as the
parent if the active window is an instance of
Frame.  The
result is much nicer, at least if the user types a
bogus
value in a property editor and needs to be
notified what
is wrong.

Doesn't seem to cause any problems on Windows -
not sure
about other os's.
Comment 1 _ tboudreau 2003-06-27 13:18:50 UTC
Created attachment 10823 [details]
Trivial patch to avoid fronting main window whenever a trivial dialog is shown
Comment 2 _ tboudreau 2003-06-27 13:20:06 UTC
CC'ing Jesse, who did a lot of messing with modal dialogs
when dealing with the help system, in case he has any idea
why it wasn't done this way in the first place.
Comment 3 Jesse Glick 2003-06-27 14:00:13 UTC
I didn't actually do much with modal dialogs at all. Sorry, but I
don't know much about focus stuff.

Re. history - it's not gone, still there in CVS. E.g.:

cvs -d
:pserver:jglick@cvs.netbeans.org:2401/shared/data/helm/cvs/repository
rlog -N core/src/org/netbeans/core/NbPresenter.java
Comment 4 mslama 2003-06-30 13:20:13 UTC
I checked on RH 8 with KDE 3.0.3. It seems OK with modal dialog. What
does it have with focus? IMO it has nothing to do with focus. It is
about owner of dialog. Owner sets z-order for OS window manager ie.
when you set for example Options window as owner for dialog dialog
cannot get behind of its owner. (But anyway because main window and
Options window are independent you can now front main window to hide
both dialog and Options window.) I will test Solaris/CDE too.
Comment 5 _ tboudreau 2003-06-30 13:50:50 UTC
The only worry would be if a component in a window behind the main
window will want to show a modal dialog.  I'm not sure, but maybe 
it could be a problem for some window manager on Linux.  At any
rate, you could always see if the window has focus (in which case,
it's probably not behind anything), and if not, do something to
make sure the dialog is on top like have it owned by the main
window.  Probably will never be a problem.
Comment 6 mslama 2003-06-30 13:58:45 UTC
It seems it is ok also on Solaris 8 with CDE. JDK 1.4.2 FCS.

Fixed in main trunk.

Modified:
/cvs/core/windows/src/org/netbeans/core/windows/DialogDisplayerImpl.java
r.1.3
Comment 7 mslama 2003-06-30 14:01:55 UTC
*** Issue 33480 has been marked as a duplicate of this issue. ***
Comment 8 Jesse Glick 2003-06-30 16:07:49 UTC
x
Comment 9 Jesse Glick 2003-06-30 16:08:13 UTC
Missing resolution.
Comment 10 Jesse Glick 2003-06-30 16:09:19 UTC
Tim, is Version really 4.0 dev? Sounds like this is older than that.
Can you set appropriately? Otherwise it is not a candidate for merging
to a 3.5.x release, for example.
Comment 11 Jesse Glick 2003-06-30 16:10:13 UTC
Specifically, issue #33480 was reported against 3.5.
Comment 12 mslama 2003-06-30 16:16:12 UTC
Yes this issue happens also on NB 3.5. However patch for NB 3.5 would
be different (due to winsys separation in trunk).
Comment 13 Jesse Glick 2003-06-30 18:17:54 UTC
Would the 3.5 and 4.0 patches really be substantially different, or
just applied to different file paths?
Comment 14 mslama 2003-07-01 09:36:50 UTC
Code would be the same just applied to NbTopManager. I change version
to 3.5.
Comment 15 mslama 2003-07-03 14:16:54 UTC
*** Issue 33080 has been marked as a duplicate of this issue. ***
Comment 16 Marian Mirilovic 2003-07-23 15:37:08 UTC
verified in [nb_dev](20030723)