comparison src/gui_gtk_x11.c @ 2187:dc8ee74574f8 v7.2.444

updated for version 7.2.444 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.
author Bram Moolenaar <bram@vim.org>
date Sun, 13 Jun 2010 02:35:46 +0200
parents b0ebf9d121ff
children 073ff46fe397
comparison
equal deleted inserted replaced
2185:0c1e413c32f1 2187:dc8ee74574f8
3476 int n_targets = N_SELECTION_TARGETS; 3476 int n_targets = N_SELECTION_TARGETS;
3477 GtkTargetEntry targets[N_SELECTION_TARGETS]; 3477 GtkTargetEntry targets[N_SELECTION_TARGETS];
3478 3478
3479 for (i = 0; i < (int)N_SELECTION_TARGETS; ++i) 3479 for (i = 0; i < (int)N_SELECTION_TARGETS; ++i)
3480 { 3480 {
3481 #ifdef FEAT_MBYTE 3481 #if defined(FEAT_MBYTE) && defined(HAVE_GTK2)
3482 /* OpenOffice tries to use TARGET_HTML and fails when it doesn't 3482 /* OpenOffice tries to use TARGET_HTML and fails when it doesn't
3483 * return something, instead of trying another target. Therefore only 3483 * return something, instead of trying another target. Therefore only
3484 * offer TARGET_HTML when it works. */ 3484 * offer TARGET_HTML when it works. */
3485 if (!clip_html && selection_targets[i].info == TARGET_HTML) 3485 if (!clip_html && selection_targets[i].info == TARGET_HTML)
3486 n_targets--; 3486 n_targets--;
3487 else 3487 else
3488 #endif 3488 #endif
3489 targets[j++] = selection_targets[i]; 3489 targets[j++] = selection_targets[i];
3490 } 3490 }
3491 3491
3492 #ifdef HAVE_GTK2 /* GTK 1 doesn't have this function */
3492 gtk_selection_clear_targets(gui.drawarea, (GdkAtom)GDK_SELECTION_PRIMARY); 3493 gtk_selection_clear_targets(gui.drawarea, (GdkAtom)GDK_SELECTION_PRIMARY);
3493 gtk_selection_clear_targets(gui.drawarea, (GdkAtom)clip_plus.gtk_sel_atom); 3494 gtk_selection_clear_targets(gui.drawarea, (GdkAtom)clip_plus.gtk_sel_atom);
3495 #endif
3494 gtk_selection_add_targets(gui.drawarea, 3496 gtk_selection_add_targets(gui.drawarea,
3495 (GdkAtom)GDK_SELECTION_PRIMARY, 3497 (GdkAtom)GDK_SELECTION_PRIMARY,
3496 targets, n_targets); 3498 targets, n_targets);
3497 gtk_selection_add_targets(gui.drawarea, 3499 gtk_selection_add_targets(gui.drawarea,
3498 (GdkAtom)clip_plus.gtk_sel_atom, 3500 (GdkAtom)clip_plus.gtk_sel_atom,