Changeset 9688 for trunk/gtk/main.c


Ignore:
Timestamp:
Dec 9, 2009, 1:42:04 AM (13 years ago)
Author:
charles
Message:

(trunk gtk) #2625 "ability to create a magnet link" -- fix "Copy Magnet Link to Clipboard" for X users who aren't using KDE or GNOME. Reported by jch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r9685 r9688  
    14961496    char * magnet = tr_torrentGetMagnetLink( tor );
    14971497    GdkDisplay * display = gtk_widget_get_display( w );
    1498     GdkAtom selection = GDK_SELECTION_CLIPBOARD;
    1499     GtkClipboard * clipboard = gtk_clipboard_get_for_display( display, selection );
     1498    GdkAtom selection;
     1499    GtkClipboard * clipboard;
     1500
     1501    /* this is The Right Thing for copy/paste... */
     1502    selection = GDK_SELECTION_CLIPBOARD;
     1503    clipboard = gtk_clipboard_get_for_display( display, selection );
    15001504    gtk_clipboard_set_text( clipboard, magnet, -1 );
     1505
     1506    /* ...but people using plain ol' X need this instead */
     1507    selection = GDK_SELECTION_PRIMARY;
     1508    clipboard = gtk_clipboard_get_for_display( display, selection );
     1509    gtk_clipboard_set_text( clipboard, magnet, -1 );
     1510
     1511    /* cleanup */
    15011512    tr_free( magnet );
    15021513}
Note: See TracChangeset for help on using the changeset viewer.