|
Karsten Hopp |
99a7dd |
To: vim-dev@vim.org
|
|
Karsten Hopp |
99a7dd |
Subject: Patch 7.2.442
|
|
Karsten Hopp |
99a7dd |
Fcc: outbox
|
|
Karsten Hopp |
99a7dd |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
99a7dd |
Mime-Version: 1.0
|
|
Karsten Hopp |
99a7dd |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
99a7dd |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
99a7dd |
------------
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
Patch 7.2.442 (after 7.2.201)
|
|
Karsten Hopp |
99a7dd |
Problem: Copy/paste with OpenOffice doesn't work.
|
|
Karsten Hopp |
99a7dd |
Solution: Do not offer the HTML target when it is not supported. (James
|
|
Karsten Hopp |
99a7dd |
Vega)
|
|
Karsten Hopp |
99a7dd |
Files: src/gui_gtk_x11.c, src/option.c, src/proto/gui_gtk_x11.pro
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
*** ../vim-7.2.441/src/gui_gtk_x11.c 2010-02-11 18:19:32.000000000 +0100
|
|
Karsten Hopp |
99a7dd |
--- src/gui_gtk_x11.c 2010-06-05 12:42:23.000000000 +0200
|
|
Karsten Hopp |
99a7dd |
***************
|
|
Karsten Hopp |
99a7dd |
*** 1433,1438 ****
|
|
Karsten Hopp |
99a7dd |
--- 1433,1442 ----
|
|
Karsten Hopp |
99a7dd |
}
|
|
Karsten Hopp |
99a7dd |
#endif /* !HAVE_GTK2 */
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
+ /* Chop off any traiing NUL bytes. OpenOffice sends these. */
|
|
Karsten Hopp |
99a7dd |
+ while (len > 0 && text[len - 1] == NUL)
|
|
Karsten Hopp |
99a7dd |
+ --len;
|
|
Karsten Hopp |
99a7dd |
+
|
|
Karsten Hopp |
99a7dd |
clip_yank_selection(motion_type, text, (long)len, cbd);
|
|
Karsten Hopp |
99a7dd |
received_selection = RS_OK;
|
|
Karsten Hopp |
99a7dd |
vim_free(tmpbuf);
|
|
Karsten Hopp |
99a7dd |
***************
|
|
Karsten Hopp |
99a7dd |
*** 3463,3468 ****
|
|
Karsten Hopp |
99a7dd |
--- 3467,3532 ----
|
|
Karsten Hopp |
99a7dd |
#endif /* FEAT_GUI_TABLINE */
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
/*
|
|
Karsten Hopp |
99a7dd |
+ * Add selection targets for PRIMARY and CLIPBOARD selections.
|
|
Karsten Hopp |
99a7dd |
+ */
|
|
Karsten Hopp |
99a7dd |
+ void
|
|
Karsten Hopp |
99a7dd |
+ gui_gtk_set_selection_targets(void)
|
|
Karsten Hopp |
99a7dd |
+ {
|
|
Karsten Hopp |
99a7dd |
+ int i, j = 0;
|
|
Karsten Hopp |
99a7dd |
+ int n_targets = N_SELECTION_TARGETS;
|
|
Karsten Hopp |
99a7dd |
+ GtkTargetEntry targets[N_SELECTION_TARGETS];
|
|
Karsten Hopp |
99a7dd |
+
|
|
Karsten Hopp |
99a7dd |
+ for (i = 0; i < (int)N_SELECTION_TARGETS; ++i)
|
|
Karsten Hopp |
99a7dd |
+ {
|
|
Karsten Hopp |
99a7dd |
+ #ifdef FEAT_MBYTE
|
|
Karsten Hopp |
99a7dd |
+ /* OpenOffice tries to use TARGET_HTML and fails when it doesn't
|
|
Karsten Hopp |
99a7dd |
+ * return something, instead of trying another target. Therefore only
|
|
Karsten Hopp |
99a7dd |
+ * offer TARGET_HTML when it works. */
|
|
Karsten Hopp |
99a7dd |
+ if (!clip_html && selection_targets[i].info == TARGET_HTML)
|
|
Karsten Hopp |
99a7dd |
+ n_targets--;
|
|
Karsten Hopp |
99a7dd |
+ else
|
|
Karsten Hopp |
99a7dd |
+ #endif
|
|
Karsten Hopp |
99a7dd |
+ targets[j++] = selection_targets[i];
|
|
Karsten Hopp |
99a7dd |
+ }
|
|
Karsten Hopp |
99a7dd |
+
|
|
Karsten Hopp |
99a7dd |
+ gtk_selection_clear_targets(gui.drawarea, (GdkAtom)GDK_SELECTION_PRIMARY);
|
|
Karsten Hopp |
99a7dd |
+ gtk_selection_clear_targets(gui.drawarea, (GdkAtom)clip_plus.gtk_sel_atom);
|
|
Karsten Hopp |
99a7dd |
+ gtk_selection_add_targets(gui.drawarea,
|
|
Karsten Hopp |
99a7dd |
+ (GdkAtom)GDK_SELECTION_PRIMARY,
|
|
Karsten Hopp |
99a7dd |
+ targets, n_targets);
|
|
Karsten Hopp |
99a7dd |
+ gtk_selection_add_targets(gui.drawarea,
|
|
Karsten Hopp |
99a7dd |
+ (GdkAtom)clip_plus.gtk_sel_atom,
|
|
Karsten Hopp |
99a7dd |
+ targets, n_targets);
|
|
Karsten Hopp |
99a7dd |
+ }
|
|
Karsten Hopp |
99a7dd |
+
|
|
Karsten Hopp |
99a7dd |
+ /*
|
|
Karsten Hopp |
99a7dd |
+ * Set up for receiving DND items.
|
|
Karsten Hopp |
99a7dd |
+ */
|
|
Karsten Hopp |
99a7dd |
+ void
|
|
Karsten Hopp |
99a7dd |
+ gui_gtk_set_dnd_targets(void)
|
|
Karsten Hopp |
99a7dd |
+ {
|
|
Karsten Hopp |
99a7dd |
+ int i, j = 0;
|
|
Karsten Hopp |
99a7dd |
+ int n_targets = N_DND_TARGETS;
|
|
Karsten Hopp |
99a7dd |
+ GtkTargetEntry targets[N_DND_TARGETS];
|
|
Karsten Hopp |
99a7dd |
+
|
|
Karsten Hopp |
99a7dd |
+ for (i = 0; i < (int)N_DND_TARGETS; ++i)
|
|
Karsten Hopp |
99a7dd |
+ {
|
|
Karsten Hopp |
99a7dd |
+ #ifdef FEAT_MBYTE
|
|
Karsten Hopp |
99a7dd |
+ if (!clip_html && selection_targets[i].info == TARGET_HTML)
|
|
Karsten Hopp |
99a7dd |
+ n_targets--;
|
|
Karsten Hopp |
99a7dd |
+ else
|
|
Karsten Hopp |
99a7dd |
+ #endif
|
|
Karsten Hopp |
99a7dd |
+ targets[j++] = dnd_targets[i];
|
|
Karsten Hopp |
99a7dd |
+ }
|
|
Karsten Hopp |
99a7dd |
+
|
|
Karsten Hopp |
99a7dd |
+ gtk_drag_dest_unset(gui.drawarea);
|
|
Karsten Hopp |
99a7dd |
+ gtk_drag_dest_set(gui.drawarea,
|
|
Karsten Hopp |
99a7dd |
+ GTK_DEST_DEFAULT_ALL,
|
|
Karsten Hopp |
99a7dd |
+ targets, n_targets,
|
|
Karsten Hopp |
99a7dd |
+ GDK_ACTION_COPY);
|
|
Karsten Hopp |
99a7dd |
+ }
|
|
Karsten Hopp |
99a7dd |
+
|
|
Karsten Hopp |
99a7dd |
+ /*
|
|
Karsten Hopp |
99a7dd |
* Initialize the GUI. Create all the windows, set up all the callbacks etc.
|
|
Karsten Hopp |
99a7dd |
* Returns OK for success, FAIL when the GUI can't be started.
|
|
Karsten Hopp |
99a7dd |
*/
|
|
Karsten Hopp |
99a7dd |
***************
|
|
Karsten Hopp |
99a7dd |
*** 3925,3939 ****
|
|
Karsten Hopp |
99a7dd |
gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_received",
|
|
Karsten Hopp |
99a7dd |
GTK_SIGNAL_FUNC(selection_received_cb), NULL);
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
! /*
|
|
Karsten Hopp |
99a7dd |
! * Add selection targets for PRIMARY and CLIPBOARD selections.
|
|
Karsten Hopp |
99a7dd |
! */
|
|
Karsten Hopp |
99a7dd |
! gtk_selection_add_targets(gui.drawarea,
|
|
Karsten Hopp |
99a7dd |
! (GdkAtom)GDK_SELECTION_PRIMARY,
|
|
Karsten Hopp |
99a7dd |
! selection_targets, N_SELECTION_TARGETS);
|
|
Karsten Hopp |
99a7dd |
! gtk_selection_add_targets(gui.drawarea,
|
|
Karsten Hopp |
99a7dd |
! (GdkAtom)clip_plus.gtk_sel_atom,
|
|
Karsten Hopp |
99a7dd |
! selection_targets, N_SELECTION_TARGETS);
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_get",
|
|
Karsten Hopp |
99a7dd |
GTK_SIGNAL_FUNC(selection_get_cb), NULL);
|
|
Karsten Hopp |
99a7dd |
--- 3989,3995 ----
|
|
Karsten Hopp |
99a7dd |
gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_received",
|
|
Karsten Hopp |
99a7dd |
GTK_SIGNAL_FUNC(selection_received_cb), NULL);
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
! gui_gtk_set_selection_targets();
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_get",
|
|
Karsten Hopp |
99a7dd |
GTK_SIGNAL_FUNC(selection_get_cb), NULL);
|
|
Karsten Hopp |
99a7dd |
***************
|
|
Karsten Hopp |
99a7dd |
*** 4057,4063 ****
|
|
Karsten Hopp |
99a7dd |
return TRUE;
|
|
Karsten Hopp |
99a7dd |
}
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
-
|
|
Karsten Hopp |
99a7dd |
/*
|
|
Karsten Hopp |
99a7dd |
* Open the GUI window which was created by a call to gui_mch_init().
|
|
Karsten Hopp |
99a7dd |
*/
|
|
Karsten Hopp |
99a7dd |
--- 4113,4118 ----
|
|
Karsten Hopp |
99a7dd |
***************
|
|
Karsten Hopp |
99a7dd |
*** 4225,4237 ****
|
|
Karsten Hopp |
99a7dd |
GTK_SIGNAL_FUNC(form_configure_event), NULL);
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
#ifdef FEAT_DND
|
|
Karsten Hopp |
99a7dd |
! /*
|
|
Karsten Hopp |
99a7dd |
! * Set up for receiving DND items.
|
|
Karsten Hopp |
99a7dd |
! */
|
|
Karsten Hopp |
99a7dd |
! gtk_drag_dest_set(gui.drawarea,
|
|
Karsten Hopp |
99a7dd |
! GTK_DEST_DEFAULT_ALL,
|
|
Karsten Hopp |
99a7dd |
! dnd_targets, N_DND_TARGETS,
|
|
Karsten Hopp |
99a7dd |
! GDK_ACTION_COPY);
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
gtk_signal_connect(GTK_OBJECT(gui.drawarea), "drag_data_received",
|
|
Karsten Hopp |
99a7dd |
GTK_SIGNAL_FUNC(drag_data_received_cb), NULL);
|
|
Karsten Hopp |
99a7dd |
--- 4280,4287 ----
|
|
Karsten Hopp |
99a7dd |
GTK_SIGNAL_FUNC(form_configure_event), NULL);
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
#ifdef FEAT_DND
|
|
Karsten Hopp |
99a7dd |
! /* Set up for receiving DND items. */
|
|
Karsten Hopp |
99a7dd |
! gui_gtk_set_dnd_targets();
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
gtk_signal_connect(GTK_OBJECT(gui.drawarea), "drag_data_received",
|
|
Karsten Hopp |
99a7dd |
GTK_SIGNAL_FUNC(drag_data_received_cb), NULL);
|
|
Karsten Hopp |
99a7dd |
***************
|
|
Karsten Hopp |
99a7dd |
*** 4428,4434 ****
|
|
Karsten Hopp |
99a7dd |
/* this will cause the proper resizement to happen too */
|
|
Karsten Hopp |
99a7dd |
update_window_manager_hints(0, 0);
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
! #else /* HAVE_GTK2 */
|
|
Karsten Hopp |
99a7dd |
/* this will cause the proper resizement to happen too */
|
|
Karsten Hopp |
99a7dd |
if (gtk_socket_id == 0)
|
|
Karsten Hopp |
99a7dd |
update_window_manager_hints(0, 0);
|
|
Karsten Hopp |
99a7dd |
--- 4478,4484 ----
|
|
Karsten Hopp |
99a7dd |
/* this will cause the proper resizement to happen too */
|
|
Karsten Hopp |
99a7dd |
update_window_manager_hints(0, 0);
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
! #else
|
|
Karsten Hopp |
99a7dd |
/* this will cause the proper resizement to happen too */
|
|
Karsten Hopp |
99a7dd |
if (gtk_socket_id == 0)
|
|
Karsten Hopp |
99a7dd |
update_window_manager_hints(0, 0);
|
|
Karsten Hopp |
99a7dd |
***************
|
|
Karsten Hopp |
99a7dd |
*** 4444,4457 ****
|
|
Karsten Hopp |
99a7dd |
else
|
|
Karsten Hopp |
99a7dd |
update_window_manager_hints(width, height);
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
! #if 0
|
|
Karsten Hopp |
99a7dd |
if (!resize_idle_installed)
|
|
Karsten Hopp |
99a7dd |
{
|
|
Karsten Hopp |
99a7dd |
g_idle_add_full(GDK_PRIORITY_EVENTS + 10,
|
|
Karsten Hopp |
99a7dd |
&force_shell_resize_idle, NULL, NULL);
|
|
Karsten Hopp |
99a7dd |
resize_idle_installed = TRUE;
|
|
Karsten Hopp |
99a7dd |
}
|
|
Karsten Hopp |
99a7dd |
! #endif
|
|
Karsten Hopp |
99a7dd |
/*
|
|
Karsten Hopp |
99a7dd |
* Wait until all events are processed to prevent a crash because the
|
|
Karsten Hopp |
99a7dd |
* real size of the drawing area doesn't reflect Vim's internal ideas.
|
|
Karsten Hopp |
99a7dd |
--- 4494,4507 ----
|
|
Karsten Hopp |
99a7dd |
else
|
|
Karsten Hopp |
99a7dd |
update_window_manager_hints(width, height);
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
! # if 0
|
|
Karsten Hopp |
99a7dd |
if (!resize_idle_installed)
|
|
Karsten Hopp |
99a7dd |
{
|
|
Karsten Hopp |
99a7dd |
g_idle_add_full(GDK_PRIORITY_EVENTS + 10,
|
|
Karsten Hopp |
99a7dd |
&force_shell_resize_idle, NULL, NULL);
|
|
Karsten Hopp |
99a7dd |
resize_idle_installed = TRUE;
|
|
Karsten Hopp |
99a7dd |
}
|
|
Karsten Hopp |
99a7dd |
! # endif
|
|
Karsten Hopp |
99a7dd |
/*
|
|
Karsten Hopp |
99a7dd |
* Wait until all events are processed to prevent a crash because the
|
|
Karsten Hopp |
99a7dd |
* real size of the drawing area doesn't reflect Vim's internal ideas.
|
|
Karsten Hopp |
99a7dd |
*** ../vim-7.2.441/src/option.c 2010-05-14 17:32:53.000000000 +0200
|
|
Karsten Hopp |
99a7dd |
--- src/option.c 2010-06-05 12:19:38.000000000 +0200
|
|
Karsten Hopp |
99a7dd |
***************
|
|
Karsten Hopp |
99a7dd |
*** 7112,7117 ****
|
|
Karsten Hopp |
99a7dd |
--- 7112,7124 ----
|
|
Karsten Hopp |
99a7dd |
clip_html = new_html;
|
|
Karsten Hopp |
99a7dd |
vim_free(clip_exclude_prog);
|
|
Karsten Hopp |
99a7dd |
clip_exclude_prog = new_exclude_prog;
|
|
Karsten Hopp |
99a7dd |
+ #ifdef FEAT_GUI_GTK
|
|
Karsten Hopp |
99a7dd |
+ if (gui.in_use)
|
|
Karsten Hopp |
99a7dd |
+ {
|
|
Karsten Hopp |
99a7dd |
+ gui_gtk_set_selection_targets();
|
|
Karsten Hopp |
99a7dd |
+ gui_gtk_set_dnd_targets();
|
|
Karsten Hopp |
99a7dd |
+ }
|
|
Karsten Hopp |
99a7dd |
+ #endif
|
|
Karsten Hopp |
99a7dd |
}
|
|
Karsten Hopp |
99a7dd |
else
|
|
Karsten Hopp |
99a7dd |
vim_free(new_exclude_prog);
|
|
Karsten Hopp |
99a7dd |
*** ../vim-7.2.441/src/proto/gui_gtk_x11.pro 2009-09-23 18:14:13.000000000 +0200
|
|
Karsten Hopp |
99a7dd |
--- src/proto/gui_gtk_x11.pro 2010-06-05 12:31:22.000000000 +0200
|
|
Karsten Hopp |
99a7dd |
***************
|
|
Karsten Hopp |
99a7dd |
*** 9,14 ****
|
|
Karsten Hopp |
99a7dd |
--- 9,16 ----
|
|
Karsten Hopp |
99a7dd |
int gui_mch_showing_tabline __ARGS((void));
|
|
Karsten Hopp |
99a7dd |
void gui_mch_update_tabline __ARGS((void));
|
|
Karsten Hopp |
99a7dd |
void gui_mch_set_curtab __ARGS((int nr));
|
|
Karsten Hopp |
99a7dd |
+ void gui_gtk_set_selection_targets __ARGS((void));
|
|
Karsten Hopp |
99a7dd |
+ void gui_gtk_set_dnd_targets __ARGS((void));
|
|
Karsten Hopp |
99a7dd |
int gui_mch_init __ARGS((void));
|
|
Karsten Hopp |
99a7dd |
void gui_mch_forked __ARGS((void));
|
|
Karsten Hopp |
99a7dd |
void gui_mch_new_colors __ARGS((void));
|
|
Karsten Hopp |
99a7dd |
*** ../vim-7.2.441/src/version.c 2010-05-30 16:55:17.000000000 +0200
|
|
Karsten Hopp |
99a7dd |
--- src/version.c 2010-06-05 12:48:01.000000000 +0200
|
|
Karsten Hopp |
99a7dd |
***************
|
|
Karsten Hopp |
99a7dd |
*** 683,684 ****
|
|
Karsten Hopp |
99a7dd |
--- 683,686 ----
|
|
Karsten Hopp |
99a7dd |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
99a7dd |
+ /**/
|
|
Karsten Hopp |
99a7dd |
+ 442,
|
|
Karsten Hopp |
99a7dd |
/**/
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
--
|
|
Karsten Hopp |
99a7dd |
hundred-and-one symptoms of being an internet addict:
|
|
Karsten Hopp |
99a7dd |
158. You get a tuner card so you can watch TV while surfing.
|
|
Karsten Hopp |
99a7dd |
|
|
Karsten Hopp |
99a7dd |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
99a7dd |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
99a7dd |
\\\ download, build and distribute -- http://www.A-A-P.org ///
|
|
Karsten Hopp |
99a7dd |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|