[7.2.444] Can't build with GTK 1, gtk_selection_clear_targets() is not
authorBram Moolenaar <Bram@moolenaar.net>
Sun, 13 Jun 2010 02:29:18 +0000 (13 02:29 +0000)
committerBram Moolenaar <Bram@moolenaar.net>
Sun, 13 Jun 2010 02:29:18 +0000 (13 02:29 +0000)
Problem:    Can't build with GTK 1, gtk_selection_clear_targets() is not
            available. (Patrick Texier)

Solution:   Don't change the targets for GTK 1, set them once.

Patch 7.2.444 (after 7.2.442)

src/gui_gtk_x11.c
src/option.c
src/version.c

index 991d2a0..81ce63c 100644 (file)
@@ -3478,7 +3478,7 @@ gui_gtk_set_selection_targets(void)
 
     for (i = 0; i < (int)N_SELECTION_TARGETS; ++i)
     {
-#ifdef FEAT_MBYTE
+#if defined(FEAT_MBYTE) && defined(HAVE_GTK2)
        /* OpenOffice tries to use TARGET_HTML and fails when it doesn't
         * return something, instead of trying another target. Therefore only
         * offer TARGET_HTML when it works. */
@@ -3489,8 +3489,10 @@ gui_gtk_set_selection_targets(void)
            targets[j++] = selection_targets[i];
     }
 
+#ifdef HAVE_GTK2  /* GTK 1 doesn't have this function */
     gtk_selection_clear_targets(gui.drawarea, (GdkAtom)GDK_SELECTION_PRIMARY);
     gtk_selection_clear_targets(gui.drawarea, (GdkAtom)clip_plus.gtk_sel_atom);
+#endif
     gtk_selection_add_targets(gui.drawarea,
                              (GdkAtom)GDK_SELECTION_PRIMARY,
                              targets, n_targets);
index 06560a7..be4bf61 100644 (file)
@@ -7112,7 +7112,7 @@ check_clipboard_option()
        clip_html = new_html;
        vim_free(clip_exclude_prog);
        clip_exclude_prog = new_exclude_prog;
-#ifdef FEAT_GUI_GTK
+#ifdef HAVE_GTK2  /* for GTK 1 we can't change the list of targets */
        if (gui.in_use)
        {
            gui_gtk_set_selection_targets();
index 89adc48..c5a029b 100644 (file)
@@ -682,6 +682,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    444,
+/**/
     443,
 /**/
     442,