(From update of attachment 411182)
>+nsClipboard::Store(void)
>+{
>+ if (mSelectionTransferable) {
>+ GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
>+ gtk_clipboard_store(clipboard);
>+ }
>+ if (mGlobalTransferable) {
http://freedesktop.org/wiki/ClipboardManager seems only intended for the
CLIPBOARD selection, not the PRIMARY. Also _gtk_clipboard_store_all() only
stores the CLIPBOARD, and gtk_clipboard_set_can_store() doesn't do anything when
clipboard->selection != GDK_SELECTION_CLIPBOARD so this first block won't do
anything, and so should be removed.
>+ PRBool ImagesAdded = PR_FALSE;
Variables in Mozilla usually start with lower case, so |imagesAdded|.
(Class names and function names start with upper case.)
>+ if (gtk_clipboard_set_with_data(gtkClipboard, gtkTargets, numTargets,
>+ clipboard_get_cb, clipboard_clear_cb, (gpointer)this))
The (gpointer) cast should be unnecessary because |this| is a |void*|.
Can you move gtk_clipboard_set_can_store to the else block, please. There's
no difference in functionality because it won't do anything when
aWhichClipboard == kSelectionClipboard, but it makes the intentions clearer.
(From update of attachment 411182) :Store( void) sferable) { get(GDK_ SELECTION_ PRIMARY) ; store(clipboard ); rable) {
>+nsClipboard:
>+{
>+ if (mSelectionTran
>+ GtkClipboard *clipboard = gtk_clipboard_
>+ gtk_clipboard_
>+ }
>+ if (mGlobalTransfe
http:// freedesktop. org/wiki/ ClipboardManage r seems only intended for the store_all( ) only set_can_ store() doesn't do anything when >selection != GDK_SELECTION_ CLIPBOARD so this first block won't do
CLIPBOARD selection, not the PRIMARY. Also _gtk_clipboard_
stores the CLIPBOARD, and gtk_clipboard_
clipboard-
anything, and so should be removed.
>+ PRBool ImagesAdded = PR_FALSE;
Variables in Mozilla usually start with lower case, so |imagesAdded|.
(Class names and function names start with upper case.)
>+ if (gtk_clipboard_ set_with_ data(gtkClipboa rd, gtkTargets, numTargets,
>+ clipboard_get_cb, clipboard_clear_cb, (gpointer)this))
The (gpointer) cast should be unnecessary because |this| is a |void*|.
>+ if (aWhichClipboard == kSelectionClipb oard) { ferable = aTransferable; set_can_ store(gtkClipbo ard, gtkTargets, numTargets);
>+ mSelectionOwner = aOwner;
>+ mSelectionTrans
>+ }
>+ else {
>+ mGlobalOwner = aOwner;
>+ mGlobalTransferable = aTransferable;
>+ }
>
>+ gtk_clipboard_
Can you move gtk_clipboard_ set_can_ store to the else block, please. There's oard, but it makes the intentions clearer.
no difference in functionality because it won't do anything when
aWhichClipboard == kSelectionClipb
r=karlt with these changes.