Closed Bug 225885 Opened 22 years ago Closed 22 years ago

nsPresShell::DoCopy does not work if the focus is outside the window

Categories

(Core :: Layout, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mpgritti, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

That is a problem for gtk embedding. In Gtk when you show a context menu the focus goes outside the window, so currently it's not possible to have Cut/Copy entries in context menu. I cant see any problem to allow to Copy also when the focus is not inside the target window (there is a focus memory that keep track of the last focused control ...).
Attachment #135651 - Attachment description: Use FocusController to get the focused element, so it works only if the focus is no more in the window → Use FocusController to get the focused element, so it works also if the focus is no more in the window
Attachment #135651 - Flags: review?(bryner)
Note that this patch won't build in a current tree, since the signature of GetScriptGlobalObject has changed. Also do_QueryInterface is null-safe, so no need to null-check focusedElement
Attachment #135708 - Flags: superreview?(bryner)
Attachment #135708 - Flags: review?(bz-vacation)
Attachment #135651 - Flags: review?(bryner)
Comment on attachment 135708 [details] [diff] [review] update for mozilla head and remove unnecessary NULL check r=bzbarsky
Attachment #135708 - Flags: review?(bz-vacation) → review+
Comment on attachment 135708 [details] [diff] [review] update for mozilla head and remove unnecessary NULL check Looks good, modulo any lurking bugs with the focus state being out of sync.
Attachment #135708 - Flags: superreview?(bryner) → superreview+
Comment on attachment 135708 [details] [diff] [review] update for mozilla head and remove unnecessary NULL check It would be good to get this in for 1.6b, so we can make sure during the beta test phase that there are not bugs with the focus state (agreed with bryner too). The fix is pretty important for the GNOME web browser that will probably base his next release on 1.6.
Attachment #135708 - Flags: approval1.6b?
bryner: this patch suggests that manager->GetFocusedContent() is a crock, as it lacks a window-ish parameter. True? /be
bryner: see last comment. /be
Also, bryner, what do you think the risk of this patch is (for 1.6b consideration)?
Attachment #135708 - Flags: approval1.6b? → approval1.6b+
Fix checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: