Closed
Bug 214583
Opened 22 years ago
Closed 22 years ago
[gtk2] windows not activating correctly
Categories
(Core :: XUL, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bryner, Assigned: bryner)
References
Details
Attachments
(2 files, 2 obsolete files)
8.51 KB,
patch
|
blizzard
:
superreview+
|
Details | Diff | Splinter Review |
8.30 KB,
patch
|
blizzard
:
review+
|
Details | Diff | Splinter Review |
This seems to be gtk2-only. If I load a page in a browser window, then open a
mail compose window, then switch back to the browser window, I cannot use
pageup/pagedown to scroll the page - focus memory is not getting restored.
Hitting tab several times does allow you to recover focus in the window.
I *think* this may be a metacity bug. I've upgraded to cvs of metacity and can't
say i see this problem. Reporter do you use metacity as your window damager ?
Assignee | ||
Comment 3•22 years ago
|
||
Ok, I found out what's going on. When the mail compose window is deactivated,
we update some commands which cause data to be fetched from the clipboard. This
can cause another iteration of the gtk mainloop, which means that we can get the
focus-in event for the browser window while we're still processing the
deactivate for the compose window. This causes gFocusWindow to incorrectly end
up set to null.
Still thinking about what the right fix is here -- I can get gFocusWindow to be
correct easily enough, but this is still likely to leave things in a bad state
as we assume the events can be handled atomically (I'm thinking of ESM and focus
controller). What I think I'd like to do is skip over events (without changing
their order in the event queue) if we're in the middle of a call to
gtk_clipboard_wait_for_*.
Assignee | ||
Comment 4•22 years ago
|
||
... but I don't see a way to make gtk, or X, do that. Which makes sense, as
being a queue means you can only take the event off the front of it.
Here are a few other ideas:
1. Make Mozilla's clipboard API be asynchronous so that it maps better to GTK's
functionality.
2. Could we could queue up the events ourselves during execution of the nested
mainloop, and re-insert them into the event queue after the clipboard function
returns? That's getting kind of messy.
3. Make Mozilla's event system able to deal with reentrancy between deactivate
and activate events.
Comment 5•22 years ago
|
||
I'd like to make the clipboard API async, if we can. It would make things soooo
much easier.
( I'd also like to do the same for the DND api while we're at it, since drop
events are async as well. )
Assignee | ||
Comment 6•22 years ago
|
||
Yet another idea is to reinstate some version of the gtk1
nsClipboard::FindSelectionNotifyEvent, which waits for the data without running
the gtk event loop. This might require no longer using GtkClipboard, though.
Assignee | ||
Comment 7•22 years ago
|
||
Ignore my earlier comment about not being able to manipulate the event queue.
This patch ports some code from the gtk1 source to wait for the SelectionNotify
event and send it to the clipboard, without letting any other events be
processed.
Assignee | ||
Updated•22 years ago
|
Attachment #130398 -
Flags: superreview?(blizzard)
Attachment #130398 -
Flags: review?(pavlov)
Comment 8•22 years ago
|
||
Making all the callers of the clipboard code, including embedders use async
clipboard APIs I suspect would be far more difficult than making the gtk2 code
sync. That said, I wish we had made the clipboard APIs async 4 years ago :/
Assignee | ||
Comment 9•22 years ago
|
||
Comment on attachment 130398 [details] [diff] [review]
patch
let's not do this. It introduces bug 56219 to the gtk port. I'll come up with
something better.
Attachment #130398 -
Attachment is obsolete: true
Attachment #130398 -
Flags: superreview?(blizzard)
Attachment #130398 -
Flags: review?(pavlov)
Assignee | ||
Comment 10•22 years ago
|
||
You know what, let's just make the clipboard API async. I'll hook up some
dependent bugs.
Assignee | ||
Comment 11•22 years ago
|
||
I think there's actually a way to do this using my original approach (with a
little tweaking). I discovered XCheckIfEvent() and can now pull events out of
the queue in the correct order. I tested it with pasting a very large amount
of text, so I'm sure I didn't introduce bug 56219.
This also fixes an unnecessary temporary string assignment in GetData(), which
should save a string copy.
Assignee | ||
Updated•22 years ago
|
Attachment #130804 -
Flags: superreview?(blizzard)
Attachment #130804 -
Flags: review?(pavlov)
Comment 12•22 years ago
|
||
Comment on attachment 130804 [details] [diff] [review]
new patch
Couple of things: use select() on the X connection (much to the chagrin of VMS)
not sleep.
Also, please declare all functions at the top of the file instead of just
defining them inline.
Assignee | ||
Comment 13•22 years ago
|
||
Comment on attachment 130804 [details] [diff] [review]
new patch
> use select() on the X connection (much to the chagrin of VMS) not sleep.
Are you saying it should be ifdef'd for VMS to still use sleep?
Assignee | ||
Comment 14•22 years ago
|
||
Fixed blizzard's comments (I took the VMS fu from gtk2xtbin.c, hope it's
right). This also fixes it to not wait for the timeout if the request
completed synchronously (i.e. copying from the same Mozilla instance).
Assignee | ||
Updated•22 years ago
|
Attachment #130804 -
Attachment is obsolete: true
Assignee | ||
Updated•22 years ago
|
Attachment #130879 -
Flags: superreview?(blizzard)
Attachment #130879 -
Flags: review?(pavlov)
Updated•22 years ago
|
Attachment #130879 -
Flags: superreview?(blizzard) → superreview+
Updated•22 years ago
|
Attachment #130804 -
Flags: superreview?(blizzard)
Assignee | ||
Comment 15•22 years ago
|
||
This patch avoids using API's that are not present in GTK+ 2.0.x.
Assignee | ||
Updated•22 years ago
|
Attachment #131613 -
Flags: review?(blizzard)
Comment 16•22 years ago
|
||
What, you don't just want to make the APIs async? :)
Assignee | ||
Comment 17•22 years ago
|
||
Comment on attachment 131613 [details] [diff] [review]
patch that works on gtk+ 2.0.x
Not right now, no :)
Assignee | ||
Updated•22 years ago
|
Attachment #131613 -
Flags: superreview?(dbaron)
Comment 18•22 years ago
|
||
Comment on attachment 131613 [details] [diff] [review]
patch that works on gtk+ 2.0.x
r=blizzard
My only comment is that WaitForRetrieval is StudlyCaps while other static
functions use_underscores, which I prefer.
Attachment #131613 -
Flags: review?(blizzard) → review+
Assignee | ||
Updated•22 years ago
|
Attachment #130804 -
Flags: review?(pavlov)
Assignee | ||
Updated•22 years ago
|
Attachment #130879 -
Flags: review?(pavlov)
Assignee | ||
Comment 19•22 years ago
|
||
Comment on attachment 131613 [details] [diff] [review]
patch that works on gtk+ 2.0.x
I'm just going to use blizzard's review since this isn't part of the default
build.
Attachment #131613 -
Flags: superreview?(dbaron)
Assignee | ||
Comment 20•22 years ago
|
||
checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 21•22 years ago
|
||
i think this may have caused bug 226405
You need to log in
before you can comment on or make changes to this bug.
Description
•