Closed Bug 129591 Opened 24 years ago Closed 24 years ago

nsWindow::Enabled is a no-op on GTK

Categories

(Core :: XUL, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: rginda, Assigned: blizzard)

References

Details

(Whiteboard: [blizzard:fixit])

Attachments

(1 file, 14 obsolete files)

30.04 KB, patch
bryner
: review+
jesup
: approval+
Details | Diff | Splinter Review
The debugger *needs* to be able to rely on this method working on all platforms for 1.0. Chris, please help stem the tide of stomach acid by providing some status as things progress.
Blocks: 100677
Blocks: 119827
Attached patch proposed patch (obsolete) — Splinter Review
This patch makes nsWindow::Enable do what it's supposed to do on GTK. It also removes nsWindow::SetModal and ModalWidgetList. Now that windows can be properly disabled the generic modality code will take care of this, as it does on Windows and Mac. This fixes a number of other modality bugs on linux as well.
That's pretty close to what I was going to do. :) Yay, rginda. I need to work out the details of how that's going to interact with embedding, though.
FWIW, Windows works the same way, and they don't seem to have embedding issues. The tree nazis are going to make it very hard to check things in after Monday, please think quickly.
Attached patch updated patch (obsolete) — Splinter Review
removes the commented out code I added in the previous patch
Attachment #73813 - Attachment is obsolete: true
Sadly, embedding is really different with windows and linux.
Attached patch patch (obsolete) — Splinter Review
This patch adds enter/leave tracking for grab widgets, puts the tracking in the right places and remerges with the tip.
Attachment #73896 - Attachment is obsolete: true
Sweet. Does this patch address your embedding concerns too?
I played with it in embedded and it didn't seem to have any problems. I think this code should handle the cases properly. Obviously, we need to test the crap out of this code.
Blizzard, If you'd explain what the leave/enter tracking is for, I'll r=. Or maybe pav would give a better review.
Comment on attachment 74028 [details] [diff] [review] patch r=pavlov
Attachment #74028 - Flags: review+
Whiteboard: [blizzard:fixit]
Comment on attachment 74028 [details] [diff] [review] patch nice cleanup. sr=alecf
Attachment #74028 - Flags: superreview+
jrgm, Drivers has requested some QA coverage before giving the a=. Could you help test this out? Do you need me to spin a build for you, or can you build with this patch?
hmm, latest patch doesn't seem to stop the user from closing a disabled window via the window manager.
Attached patch new patch (obsolete) — Splinter Review
patch that handles the destroy case
Attachment #74028 - Attachment is obsolete: true
I think I found a way to reproduce the activation problem you saw, blizzard. 1. Open two nav windows 2. Enter "1" into the location bar in one of the windows and press enter 3. While the "Connection refused" modal dialog is up, focus the other location bar and type some text. 4. Dismiss the "Connection refused" dialog. 5. Try to focus the location bar on the first nav window.
Attached patch checkpointing changes (obsolete) — Splinter Review
Attached patch working patch (obsolete) — Splinter Review
This patch fixes the focus issues, at least as near as I can tell. Please take it out for a test drive.
Attachment #75292 - Attachment is obsolete: true
Attachment #77093 - Attachment is obsolete: true
Blocks: 65521
Reviews? Testing? Anyone?
No longer blocks: 65521
Blocks: 65521
Taking QA from jrgm. I've been running with previous versions of the patch and apart from the issues posted here it's been fine. Downloading the latest one now and I'll take it for a spin. Btw, thanks for doing this. This fix does rock :)
No longer blocks: 65521
QA Contact: jrgm → caillon
there are too many issues on the trunk right now to know where the regressions are coming from. I'm creating a branch build to test with now, I'll report back when I have more info.
I see no regressions as a result of this patch. Over the past few days I've been doing testing with "Always ask me whether to accept cookies" -- this displays a ton of modal dialogs. I've been bringing up various other dialogs in the prefs window, mailnews account windows, done testing with opening multiple modals at once, closing them in reverse order, etc. I've inspected modals and debugged modals with no side effect that I could discern. It all worked beautifully! I have only noticed one thing which might not even be related to this patch, and just may be a lesser bug that we've uncovered: Trying to DOM inspect a modal window does not work right away. The node view doesn't immediately refresh all the time. For it to work, you must first switch views (eg. from DOM Object view to JS Object view) and then back. This is not a terribly huge issue as there is a workaround and it is surely better than not able to inspect them at all. I'm fine with this patch. But would be even happier of course if this little minor issue were fixed.
Keywords: patch, review
If this fixes the bug 65521 then it's surely worthy to have it in for mozilla1.0. Is it possible to catch the m1.0 train?
Attached patch new patch (obsolete) — Splinter Review
This patch fixes a subtle bug I found where you could highlight and drag off the window, releasing over another mozilla window and the mouse up event would be missed. It also cleans up some other buglets that I've found.
Attachment #78077 - Attachment is obsolete: true
Attached patch patch (obsolete) — Splinter Review
Fix a couple of other bugs that I've found. Please test this one.
Attachment #79252 - Attachment is obsolete: true
Attached patch patch (obsolete) — Splinter Review
This fixed problems with clicks not working on combo boxes.
Attachment #79322 - Attachment is obsolete: true
Attached patch patch (obsolete) — Splinter Review
Fix problems with crashes on some combo boxes with native scrollbars.
Attachment #79521 - Attachment is obsolete: true
Attached patch patch (obsolete) — Splinter Review
Patch that fixes modal windows in embedding. Needed to check to see if the event target window was the child of a regular grabbing gtk widget - if so don't rewrite the event.
Attachment #79815 - Attachment is obsolete: true
Argh. There are still issues here. I need a different approach.
Attached patch patch (obsolete) — Splinter Review
This is a patch that seems to work in all the cases that I can find. And, it's much smaller and much cleaner. I would appreciate it if people would test this out. The old patch: 5 files changed, 228 insertions(+), 316 deletions(-) This patch: 5 files changed, 214 insertions(+), 417 deletions(-)
Attachment #79921 - Attachment is obsolete: true
Comment on attachment 80734 [details] [diff] [review] patch This patch looks good. Fixes the DOM Inspector issue I had, as well another issue I forgot to mention here with right clicks not working in any window while a modal in another was up.
Attached patch patch (obsolete) — Splinter Review
This patch fixes a problem where if you brought up a popup window and then clicked on the root window the popup window wouldn't dismiss. Only minor changes from previous patch.
Attachment #80734 - Attachment is obsolete: true
the patch works great; no more accidental crash because of closing wrong window after search.
I don't know of any outstanding problems with the latest patch so I want to run the gauntlet and try to get this into the tree. Rob was seeing some instabilities but it was hard to tell if it was from the fact that he was using the tip or from my patch. I certainly haven't seen any problems.
I havn't seen any on the branch, and someone recently filed bug 140088 "Chatzilla is crashing when switching tabs", which is most likely what I had been seeing.
I hadn't encountered many of the issues posted here with every day use. I also think this patch is ready for prime time. All the issues I had were resolved and it seems rock solid. Let's get this in :)
Will this be just the trunk, or RC2 as well?
I'd like to get it into RC2 but time is running short. This needs to bake for a bit on the trunk.
Comment on attachment 81005 [details] [diff] [review] patch >+ // Find out if there's a grabbing widget. If there is and it's a >+ // regular gtk widget and our current event window is not the >+ // child of that grab widget we need to rewrite the event to that >+ // gtk grabbing widget. A couple of commas could do wonders for this comment. >Index: nsWindow.cpp >=================================================================== >RCS file: /cvsroot/mozilla/widget/src/gtk/nsWindow.cpp,v >retrieving revision 1.369.2.1 >diff -u -r1.369.2.1 nsWindow.cpp >--- nsWindow.cpp 10 Apr 2002 03:35:04 -0000 1.369.2.1 >+++ nsWindow.cpp 25 Apr 2002 18:48:46 -0000 >@@ -169,6 +169,24 @@ > } > #endif > >+ >+// This function will check if a button event falls inside of a >+// window's bounds. >+static PRBool >+ButtonEventInsideWindow (GdkWindow *window, GdkEventButton *aGdkButtonEvent) >+{ >+ gint x, y; >+ gint width, height; >+ gdk_window_get_position(window, &x, &y); >+ gdk_window_get_size(window, &width, &height); >+ >+ if (aGdkButtonEvent->x >= x && aGdkButtonEvent->y >= y && >+ aGdkButtonEvent->x <= width && aGdkButtonEvent->y <= height) >+ return TRUE; >+ >+ return FALSE; >+} Shouldn't you be checking |x + width| and |y + height| as the upper bound, not just |width| and |height|? >+ >+NS_IMETHODIMP >+nsWindow::IsEnabled(PRBool *aState) >+{ >+ NS_ENSURE_ARG_POINTER(aState); >+ >+ *aState = !mMozArea || GTK_WIDGET_IS_SENSITIVE(mMozArea); >+ >+ return NS_OK; >+} >+ There's really no need to null-check the out parameter here. >@@ -1466,6 +1526,107 @@ > > ////////////////////////////////////////////////////////////////////// > /* virtual */ void >+nsWindow::OnMotionNotifySignal(GdkEventMotion *aGdkMotionEvent) >+{ >+ // If there's a rollup widget and this window is not a popup window, >+ // drop the event. >+ if (gRollupWidget && GetOwningWindowType() != eWindowType_popup) { >+ return; >+ } >+ >+ XEvent xevent; >+ GdkEvent gdk_event; >+ PRBool synthEvent = PR_FALSE; >+ while (XCheckWindowEvent(GDK_DISPLAY(), >+ GDK_WINDOW_XWINDOW(mSuperWin->bin_window), >+ ButtonMotionMask, &xevent)) { >+ synthEvent = PR_TRUE; >+ } This is more compact, but it seems like: if (XCheckWindowEvent(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(mSuperWin->bin_window), ButtonMotionMask, &xevent)) synthEvent = PR_TRUE; while (XCheckWindowEvent(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(mSuperWin->bin_window), ButtonMotionMask, &xevent)); would be slightly more efficient. Your call.
> A couple of commas could do wonders for this comment. Yeah, it's a bit of a run on sentence. I'll fix it. >>+ gdk_window_get_position(window, &x, &y); >>+ gdk_window_get_size(window, &width, &height); >>+ >>+ if (aGdkButtonEvent->x >= x && aGdkButtonEvent->y >= y && >>+ aGdkButtonEvent->x <= width && aGdkButtonEvent->y <= height) >>+ return TRUE; >>+ >>+ return FALSE; >>+} > > Shouldn't you be checking |x + width| and |y + height| as the upper bound, not > just |width| and |height|? No, the event is relative to the window that gets the event. This means that if you clicked in the very upper left hand corner of the window the x,y would be 0,0 while if you clicked in the lower right hand corder the event x,y would be width,height. > This is more compact, but it seems like: > > if (XCheckWindowEvent(GDK_DISPLAY(), > GDK_WINDOW_XWINDOW(mSuperWin->bin_window), > ButtonMotionMask, &xevent)) > synthEvent = PR_TRUE; > while (XCheckWindowEvent(GDK_DISPLAY(), > GDK_WINDOW_XWINDOW(mSuperWin->bin_window), > ButtonMotionMask, &xevent)); > > would be slightly more efficient. Your call. I don't think it's any more efficient. You don't end up calling it any fewer times. I'll upload a new patch in a bit.
Attachment #81005 - Attachment is obsolete: true
Attached patch patchSplinter Review
oops, add width + x and height + y when calculating if the event is in the window.
Attachment #81237 - Attachment is obsolete: true
Comment on attachment 81245 [details] [diff] [review] patch r=bryner
Attachment #81245 - Flags: review+
Comment on attachment 81245 [details] [diff] [review] patch sr=jst
Attachment #81245 - Flags: superreview+
Checked in on the trunk.
Blocks: 130855
Checked in on the 1.0 branch.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
This bug caused a severe regression (menu mouseover doesn't work), see bug 141943. Commands to back this out: cvs update -j1.117.2.2 -j1.117.2.1 widget/src/gtk/nsWindow.h cvs update -j1.369.2.2 -j1.369.2.1 widget/src/gtk/nsWindow.cpp cvs update -j1.123.2.2 -j1.123.2.1 widget/src/gtk/nsWidget.h cvs update -j1.274.2.2 -j1.274.2.1 widget/src/gtk/nsWidget.cpp cvs update -j1.169.2.2 -j1.169.2.1 widget/src/gtk/nsGtkEventHandler.cpp cvs update -j1.30.16.2 -j1.30.16.1 widget/public/nsILookAndFeel.h
adding branch resolution keyword
Keywords: fixed1.0.0
Verified fixed. Linux RC2 and Linux trunk 2002051008.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: