Closed Bug 226405 Opened 21 years ago Closed 21 years ago

[gtk2] paste into html compose window doesn't work

Categories

(Core :: XUL, defect)

x86
Linux
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla1.6beta

People

(Reporter: darin.moz, Assigned: darin.moz)

Details

(Keywords: regression)

Attachments

(1 file)

paste into mail compose window doesn't work.  this might be specific to the
GTK2+XFT build.  i've noticed this problem in both seamonkey and thunderbird. 
there aren't any messages in the javascript console.  i'll provide more info
once i have a debug build that i can test.
Keywords: regression
i meant to add that paste works into other fields, such as the mail message
compose summary field or the address fields.  i think this is specific to the
mail message compose window.  i haven't tried regular composer.
Menu command, keyboard shortcut, context menu, have you tried them all?  (I
assume they all exist on Linux?)

What does it do - just nothing?  Menu command greyed out or not?
i think this may have been caused by bug 214583.  it looks like this is a bug in
the nsClipboard.cpp code inside widget/src/gtk2.  wait_for_contents returns with
a non-null selectionData, but the contents of selectionData are bogus:

(gdb) p *selectionData
$8 = {selection = 0x1, target = 0x74, type = 0x0, format = 0, data = 0x0, length
= -1, display = 0x8081508}

-> bryner
Assignee: sspitzer → bryner
Component: Composition → XP Toolkit/Widgets
Product: MailNews → Browser
Summary: paste into mail compose window doesn't work → GTK2: paste into mail compose window doesn't work
Summary: GTK2: paste into mail compose window doesn't work → [gtk2] paste into mail compose window doesn't work
This also seems to be specific to HTML compose.  Plain text compose doesn't show
the problem for me.
Attached patch v1 patchSplinter Review
bryner and i came up with this today.  turns out GTK+-2.2.2 does this in its
code. we should do the same.  the patch causes selectionData to be null when we
return from wait_for_contents.	as a result, we will request the selection
flavor.
Attachment #136076 - Flags: review?(bryner)
Comment on attachment 136076 [details] [diff] [review]
v1 patch

r/sr=bryner
Attachment #136076 - Flags: superreview+
Attachment #136076 - Flags: review?(bryner)
Attachment #136076 - Flags: review+
here's the GTK+-2.2.2 code:

static void
clipboard_received_func (GtkClipboard     *clipboard,
             GtkSelectionData *selection_data,
             gpointer          data)
{
  WaitResults *results = data;
                                                                               
                                                                         
  if (selection_data->length >= 0)
    results->data = gtk_selection_data_copy (selection_data);
                                                                               
                                                                         
  g_main_loop_quit (results->loop);
}

here's our current version of this function:

static void
clipboard_contents_received(GtkClipboard     *clipboard,
                            GtkSelectionData *selection_data,
                            gpointer          data)
{
    GtkSelectionData **sel_copy = NS_STATIC_CAST(GtkSelectionData **, data);
    *sel_copy = gtk_selection_data_copy(selection_data);
}

the patch makes our code behave like the code from GTK+-2.2.2 :)
-> me for checkin
Assignee: bryner → darin
Comment on attachment 136076 [details] [diff] [review]
v1 patch

this would be a good patch to get in for beta.
Attachment #136076 - Flags: approval1.6b?
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.6beta
Comment on attachment 136076 [details] [diff] [review]
v1 patch

a=brendan@mozilla.org and drivers for 1.6b.

/be
Attachment #136076 - Flags: approval1.6b? → approval1.6b+
fixed on trunk for 1.6 beta
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Summary: [gtk2] paste into mail compose window doesn't work → [gtk2] paste into html compose window doesn't work
This checkin is causing long UI pauses in my gtk2/xft build (bug 226267).
The value of selection_data->length always seems to be -1 in my limited
testing.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
marking FIXED again now that bryner has a patch in bug 226267.
Status: REOPENED → RESOLVED
Closed: 21 years ago21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: